From b80c4544592fe8cf665c4e76b91f912c50877c51 Mon Sep 17 00:00:00 2001 From: Phillip Cloud Date: Mon, 18 Jan 2021 09:07:09 -0500 Subject: [PATCH] nixos/nomad: add mkIf for StateDirectory --- nixos/modules/services/networking/nomad.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nixos/modules/services/networking/nomad.nix b/nixos/modules/services/networking/nomad.nix index 10fe63f8425..0845b4f97b8 100644 --- a/nixos/modules/services/networking/nomad.nix +++ b/nixos/modules/services/networking/nomad.nix @@ -135,12 +135,11 @@ in 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 + (mkIf (cfg.settings.data_dir == "/var/lib/nomad") { StateDirectory = "nomad"; }) ]; unitConfig = {