Merge pull request #110614 from cpcloud/nomad-mkdefault-data-dir

nixos/nomad: fix data_dir-default-not-propagating bug
This commit is contained in:
Robert Hensing 2021-01-23 21:09:27 +01:00 committed by GitHub
commit e03103707b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,10 +51,7 @@ in
settings = mkOption { settings = mkOption {
type = format.type; type = format.type;
default = { default = {};
# Agrees with `StateDirectory = "nomad"` set below.
data_dir = "/var/lib/nomad";
};
description = '' description = ''
Configuration for Nomad. See the <link xlink:href="https://www.nomadproject.io/docs/configuration">documentation</link> Configuration for Nomad. See the <link xlink:href="https://www.nomadproject.io/docs/configuration">documentation</link>
for supported values. for supported values.
@ -77,6 +74,11 @@ in
##### implementation ##### implementation
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.nomad.settings = {
# Agrees with `StateDirectory = "nomad"` set below.
data_dir = mkDefault "/var/lib/nomad";
};
environment = { environment = {
etc."nomad.json".source = format.generate "nomad.json" cfg.settings; etc."nomad.json".source = format.generate "nomad.json" cfg.settings;
systemPackages = [ cfg.package ]; systemPackages = [ cfg.package ];
@ -114,6 +116,7 @@ in
} // (optionalAttrs cfg.enableDocker { } // (optionalAttrs cfg.enableDocker {
SupplementaryGroups = "docker"; # space-separated string SupplementaryGroups = "docker"; # space-separated string
}); });
unitConfig = { unitConfig = {
StartLimitIntervalSec = 10; StartLimitIntervalSec = 10;
StartLimitBurst = 3; StartLimitBurst = 3;