1 { config, lib, pkgs, ... }:
7 cfg = config.services.munge;
18 enable = mkEnableOption "munge service";
21 default = "/etc/munge/munge.key";
24 The path to a daemon's secret key.
34 config = mkIf cfg.enable {
36 environment.systemPackages = [ pkgs.munge ];
39 description = "Munge daemon user";
44 users.groups.munge = {};
46 systemd.services.munged = {
47 wantedBy = [ "multi-user.target" ];
49 "network-online.target"
53 "network-online.target"
57 path = [ pkgs.munge pkgs.coreutils ];
60 ExecStartPre = "+${pkgs.coreutils}/bin/chmod 0400 ${cfg.password}";
61 ExecStart = "${pkgs.munge}/bin/munged --foreground --key-file ${cfg.password}";
64 StateDirectory = "munge";
65 StateDirectoryMode = "0711";
66 Restart = "on-failure";
67 RuntimeDirectory = "munge";