Merge pull request #147670 from GTrunSec/nomad

nixos/nomad: fix multi-plugin-dir path
This commit is contained in:
Nick Cao 2023-01-19 14:29:08 +08:00 committed by GitHub
commit 33ba834c72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 4 deletions

View file

@ -609,6 +609,13 @@
information about the current generation revision
</para>
</listitem>
<listitem>
<para>
The option
<literal>services.nomad.extraSettingsPlugins</literal> has
been fixed to allow more than one plugin in the path.
</para>
</listitem>
</itemizedlist>
</section>
</section>

View file

@ -156,3 +156,5 @@ In addition to numerous new and upgraded packages, this release has the followin
- [Xastir](https://xastir.org/index.php/Main_Page) can now access AX.25 interfaces via the `libax25` package.
- `nixos-version` now accepts `--configuration-revision` to display more information about the current generation revision
- The option `services.nomad.extraSettingsPlugins` has been fixed to allow more than one plugin in the path.

View file

@ -67,7 +67,7 @@ in
Additional plugins dir used to configure nomad.
'';
example = literalExpression ''
[ "<pluginDir>" pkgs.<plugins-name> ]
[ "<pluginDir>" pkgs.nomad-driver-nix pkgs.nomad-driver-podman ]
'';
};
@ -139,9 +139,16 @@ 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: " -plugin-dir=${path}/bin") cfg.extraSettingsPlugins;
ExecStart =
let
pluginsDir = pkgs.symlinkJoin
{
name = "nomad-plugins";
paths = cfg.extraSettingsPlugins;
};
in
"${cfg.package}/bin/nomad agent -config=/etc/nomad.json -plugin-dir=${pluginsDir}/bin" +
concatMapStrings (path: " -config=${path}") cfg.extraSettingsPaths;
KillMode = "process";
KillSignal = "SIGINT";
LimitNOFILE = 65536;