summary refs log tree commit diff
path: root/nixos/modules/services/networking/nomad.nix
diff options
context:
space:
mode:
authorGTrunSec <gtrunsec@hardenedlinux.org>2021-11-17 15:42:05 -0800
committerGTrunSec <gtrunsec@hardenedlinux.org>2021-11-17 15:42:05 -0800
commit6a1fdd60e6e74f7ae85a647eb7552fd9591640ab (patch)
treea8d8089b82e579f054e329aeeec0539f92b9331c /nixos/modules/services/networking/nomad.nix
parentd5321ca4ad2d56070c52c98c7b8da82d55eba0fc (diff)
downloadnixpkgs-6a1fdd60e6e74f7ae85a647eb7552fd9591640ab.tar
nixpkgs-6a1fdd60e6e74f7ae85a647eb7552fd9591640ab.tar.gz
nixpkgs-6a1fdd60e6e74f7ae85a647eb7552fd9591640ab.tar.bz2
nixpkgs-6a1fdd60e6e74f7ae85a647eb7552fd9591640ab.tar.lz
nixpkgs-6a1fdd60e6e74f7ae85a647eb7552fd9591640ab.tar.xz
nixpkgs-6a1fdd60e6e74f7ae85a647eb7552fd9591640ab.tar.zst
nixpkgs-6a1fdd60e6e74f7ae85a647eb7552fd9591640ab.zip
nixos/nomad: add flag of plugin-dir
Diffstat (limited to 'nixos/modules/services/networking/nomad.nix')
-rw-r--r--nixos/modules/services/networking/nomad.nix19
1 files changed, 16 insertions, 3 deletions
diff --git a/nixos/modules/services/networking/nomad.nix b/nixos/modules/services/networking/nomad.nix
index 3bd15bd5c80..43333af5e2f 100644
--- a/nixos/modules/services/networking/nomad.nix
+++ b/nixos/modules/services/networking/nomad.nix
@@ -51,7 +51,7 @@ in
 
       extraSettingsPaths = mkOption {
         type = types.listOf types.path;
-        default = [];
+        default = [ ];
         description = ''
           Additional settings paths used to configure nomad. These can be files or directories.
         '';
@@ -60,9 +60,21 @@ in
         '';
       };
 
+      extraSettingsPlugins = mkOption {
+        type = types.listOf (types.either types.package types.path);
+        default = [ ];
+        description = ''
+          Additional plugins dir used to configure nomad.
+        '';
+        example = literalExpression ''
+          [ "<pluginDir>" "pkgs.<plugins-name>"]
+        '';
+      };
+
+
       settings = mkOption {
         type = format.type;
-        default = {};
+        default = { };
         description = ''
           Configuration for Nomad. See the <link xlink:href="https://www.nomadproject.io/docs/configuration">documentation</link>
           for supported values.
@@ -128,7 +140,8 @@ in
           DynamicUser = cfg.dropPrivileges;
           ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
           ExecStart = "${cfg.package}/bin/nomad agent -config=/etc/nomad.json" +
-            concatMapStrings (path: " -config=${path}") cfg.extraSettingsPaths;
+            concatMapStrings (path: " -config=${path}") cfg.extraSettingsPaths +
+            concatMapStrings (path: " -plugin-dir=${path}/bin") cfg.extraSettingsPlugins;
           KillMode = "process";
           KillSignal = "SIGINT";
           LimitNOFILE = 65536;