1 { config, lib, pkgs, ... }:
3 cfg = config.services.pacemaker;
7 options.services.pacemaker = {
8 enable = lib.mkEnableOption "pacemaker";
10 package = lib.mkPackageOption pkgs "pacemaker" { };
14 config = lib.mkIf cfg.enable {
16 assertion = config.services.corosync.enable;
18 Enabling services.pacemaker requires a services.corosync configuration.
22 environment.systemPackages = [ cfg.package ];
24 # required by pacemaker
25 users.users.hacluster = {
28 home = "/var/lib/pacemaker";
30 users.groups.pacemaker = {};
32 systemd.tmpfiles.rules = [
33 "d /var/log/pacemaker 0700 hacluster pacemaker -"
36 systemd.packages = [ cfg.package ];
37 systemd.services.pacemaker = {
38 wantedBy = [ "multi-user.target" ];
40 StateDirectory = "pacemaker";
41 StateDirectoryMode = "0700";