diff options
author | Phillip Cloud <cloud@standard.ai> | 2021-01-18 09:05:59 -0500 |
---|---|---|
committer | Phillip Cloud <cloud@standard.ai> | 2021-01-23 19:44:37 -0500 |
commit | 58fe45936e89afef1e3ac35f80d07eb6b0a7ab20 (patch) | |
tree | db79ad129818d80febc893c674c6cb38eb032561 /nixos/modules/services/networking/nomad.nix | |
parent | f3aa71b7ec19f380192e9e31c6f208988777e341 (diff) |
nixos/nomad: move serviceConfig into mkMerge and mkIf for docker SupplementaryGroups
Diffstat (limited to 'nixos/modules/services/networking/nomad.nix')
-rw-r--r-- | nixos/modules/services/networking/nomad.nix | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/nixos/modules/services/networking/nomad.nix b/nixos/modules/services/networking/nomad.nix index b58b5c9182c63..10fe63f8425ac 100644 --- a/nixos/modules/services/networking/nomad.nix +++ b/nixos/modules/services/networking/nomad.nix @@ -122,25 +122,26 @@ in iptables ]); - serviceConfig = { - DynamicUser = cfg.dropPrivileges; - ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; - ExecStart = "${cfg.package}/bin/nomad agent -config=/etc/nomad.json" + - concatMapStrings (path: " -config=${path}") cfg.extraSettingsPaths; - KillMode = "process"; - KillSignal = "SIGINT"; - LimitNOFILE = 65536; - LimitNPROC = "infinity"; - OOMScoreAdjust = -1000; - Restart = "on-failure"; - RestartSec = 2; - # Agrees with the default `data_dir = "/var/lib/nomad"` in `settings` above. - StateDirectory = "nomad"; - TasksMax = "infinity"; - User = optionalString cfg.dropPrivileges "nomad"; - } // (optionalAttrs cfg.enableDocker { - SupplementaryGroups = "docker"; # space-separated string - }); + serviceConfig = mkMerge [ + { + DynamicUser = cfg.dropPrivileges; + ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; + ExecStart = "${cfg.package}/bin/nomad agent -config=/etc/nomad.json" + + concatMapStrings (path: " -config=${path}") cfg.extraSettingsPaths; + KillMode = "process"; + KillSignal = "SIGINT"; + LimitNOFILE = 65536; + LimitNPROC = "infinity"; + OOMScoreAdjust = -1000; + Restart = "on-failure"; + RestartSec = 2; + # Agrees with the default `data_dir = "/var/lib/nomad"` in `settings` above. + StateDirectory = "nomad"; + TasksMax = "infinity"; + User = optionalString cfg.dropPrivileges "nomad"; + } + (mkIf cfg.enableDocker { SupplementaryGroups = "docker"; }) # space-separated string + ]; unitConfig = { StartLimitIntervalSec = 10; |