git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #110614 from cpcloud/nomad-mkdefault-data-dir

nixos/nomad: fix data_dir-default-not-propagating bug

commite03103707b2cadbc733661e4d7a12df312dd4579 authorRobert Hensing <roberth@users.noreply.github.com> dateSat 23 Jan 2021, 21:09 (6 years ago) parent22168fb2861d26
1 file changed+7−4
nixos/modules/services/networking/nomad.nix+7−4
nixos/modules/services/networking/nomad.nix+7−4
@@ -51,10 +51,7 @@ in
5151
5252 settings = mkOption {
5353 type = format.type;
54− default = {
55− # Agrees with `StateDirectory = "nomad"` set below.
56− data_dir = "/var/lib/nomad";
57− };
54+ default = {};
5855 description = ''
5956 Configuration for Nomad. See the <link xlink:href="https://www.nomadproject.io/docs/configuration">documentation</link>
6057 for supported values.
@@ -77,6 +74,11 @@ in
7774
7875 ##### implementation
7976 config = mkIf cfg.enable {
77+ services.nomad.settings = {
78+ # Agrees with `StateDirectory = "nomad"` set below.
79+ data_dir = mkDefault "/var/lib/nomad";
80+ };
81+
8082 environment = {
8183 etc."nomad.json".source = format.generate "nomad.json" cfg.settings;
8284 systemPackages = [ cfg.package ];
@@ -114,6 +116,7 @@ in
114116 } // (optionalAttrs cfg.enableDocker {
115117 SupplementaryGroups = "docker"; # space-separated string
116118 });
119+
117120 unitConfig = {
118121 StartLimitIntervalSec = 10;
119122 StartLimitBurst = 3;