nixos/nomad: add extraSettingsFiles option to nomad service (#109761)

This commit is contained in:
Phillip Cloud
2021-01-23 23:52:19 +01:00
committed by GitHub
parent 1af6e3aeed
commit f1778cd90e
3 changed files with 67 additions and 1 deletions
+13 -1
View File
@@ -49,6 +49,17 @@ in
'';
};
extraSettingsPaths = mkOption {
type = types.listOf types.path;
default = [];
description = ''
Additional settings paths used to configure nomad. These can be files or directories.
'';
example = literalExample ''
[ "/etc/nomad-mutable.json" "/run/keys/nomad-with-secrets.json" "/etc/nomad/config.d" ]
'';
};
settings = mkOption {
type = format.type;
default = {};
@@ -101,7 +112,8 @@ in
serviceConfig = {
DynamicUser = cfg.dropPrivileges;
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
ExecStart = "${cfg.package}/bin/nomad agent -config=/etc/nomad.json";
ExecStart = "${cfg.package}/bin/nomad agent -config=/etc/nomad.json" +
concatMapStrings (path: " -config=${path}") cfg.extraSettingsPaths;
KillMode = "process";
KillSignal = "SIGINT";
LimitNOFILE = 65536;