12 cfg = config.services.munge;
23 enable = mkEnableOption "munge service";
26 default = "/etc/munge/munge.key";
29 The path to a daemon's secret key.
39 config = mkIf cfg.enable {
41 environment.systemPackages = [ pkgs.munge ];
44 description = "Munge daemon user";
49 users.groups.munge = { };
51 systemd.services.munged = {
52 wantedBy = [ "multi-user.target" ];
54 "network-online.target"
58 "network-online.target"
68 ExecStartPre = "+${pkgs.coreutils}/bin/chmod 0400 ${cfg.password}";
69 ExecStart = "${pkgs.munge}/bin/munged --foreground --key-file ${cfg.password}";
72 StateDirectory = "munge";
73 StateDirectoryMode = "0711";
74 Restart = "on-failure";
75 RuntimeDirectory = "munge";