nixos/nomad: fix multi-plugin-dir path

This commit is contained in:
guangtao 2023-01-18 22:22:43 -08:00
parent a841e26226
commit b5a3f795c3
3 changed files with 20 additions and 4 deletions

View File

@ -609,6 +609,13 @@
information about the current generation revision information about the current generation revision
</para> </para>
</listitem> </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> </itemizedlist>
</section> </section>
</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. - [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 - `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. Additional plugins dir used to configure nomad.
''; '';
example = literalExpression '' example = literalExpression ''
[ "<pluginDir>" pkgs.<plugins-name> ] [ "<pluginDir>" pkgs.nomad-driver-nix pkgs.nomad-driver-podman ]
''; '';
}; };
@ -139,9 +139,16 @@ in
{ {
DynamicUser = cfg.dropPrivileges; DynamicUser = cfg.dropPrivileges;
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
ExecStart = "${cfg.package}/bin/nomad agent -config=/etc/nomad.json" + ExecStart =
concatMapStrings (path: " -config=${path}") cfg.extraSettingsPaths + let
concatMapStrings (path: " -plugin-dir=${path}/bin") cfg.extraSettingsPlugins; 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"; KillMode = "process";
KillSignal = "SIGINT"; KillSignal = "SIGINT";
LimitNOFILE = 65536; LimitNOFILE = 65536;