8 cfg = config.services.pacemaker;
12 options.services.pacemaker = {
13 enable = lib.mkEnableOption "pacemaker";
15 package = lib.mkPackageOption pkgs "pacemaker" { };
19 config = lib.mkIf cfg.enable {
22 assertion = config.services.corosync.enable;
24 Enabling services.pacemaker requires a services.corosync configuration.
29 environment.systemPackages = [ cfg.package ];
31 # required by pacemaker
32 users.users.hacluster = {
35 home = "/var/lib/pacemaker";
37 users.groups.pacemaker = { };
39 systemd.tmpfiles.rules = [
40 "d /var/log/pacemaker 0700 hacluster pacemaker -"
43 systemd.packages = [ cfg.package ];
44 systemd.services.pacemaker = {
45 wantedBy = [ "multi-user.target" ];
47 StateDirectory = "pacemaker";
48 StateDirectoryMode = "0700";