nixos/nomad: move serviceConfig into mkMerge and mkIf for docker SupplementaryGroups
This commit is contained in:
parent
f3aa71b7ec
commit
58fe45936e
@ -122,25 +122,26 @@ in
|
|||||||
iptables
|
iptables
|
||||||
]);
|
]);
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = mkMerge [
|
||||||
DynamicUser = cfg.dropPrivileges;
|
{
|
||||||
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
DynamicUser = cfg.dropPrivileges;
|
||||||
ExecStart = "${cfg.package}/bin/nomad agent -config=/etc/nomad.json" +
|
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||||
concatMapStrings (path: " -config=${path}") cfg.extraSettingsPaths;
|
ExecStart = "${cfg.package}/bin/nomad agent -config=/etc/nomad.json" +
|
||||||
KillMode = "process";
|
concatMapStrings (path: " -config=${path}") cfg.extraSettingsPaths;
|
||||||
KillSignal = "SIGINT";
|
KillMode = "process";
|
||||||
LimitNOFILE = 65536;
|
KillSignal = "SIGINT";
|
||||||
LimitNPROC = "infinity";
|
LimitNOFILE = 65536;
|
||||||
OOMScoreAdjust = -1000;
|
LimitNPROC = "infinity";
|
||||||
Restart = "on-failure";
|
OOMScoreAdjust = -1000;
|
||||||
RestartSec = 2;
|
Restart = "on-failure";
|
||||||
# Agrees with the default `data_dir = "/var/lib/nomad"` in `settings` above.
|
RestartSec = 2;
|
||||||
StateDirectory = "nomad";
|
# Agrees with the default `data_dir = "/var/lib/nomad"` in `settings` above.
|
||||||
TasksMax = "infinity";
|
StateDirectory = "nomad";
|
||||||
User = optionalString cfg.dropPrivileges "nomad";
|
TasksMax = "infinity";
|
||||||
} // (optionalAttrs cfg.enableDocker {
|
User = optionalString cfg.dropPrivileges "nomad";
|
||||||
SupplementaryGroups = "docker"; # space-separated string
|
}
|
||||||
});
|
(mkIf cfg.enableDocker { SupplementaryGroups = "docker"; }) # space-separated string
|
||||||
|
];
|
||||||
|
|
||||||
unitConfig = {
|
unitConfig = {
|
||||||
StartLimitIntervalSec = 10;
|
StartLimitIntervalSec = 10;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user