Merge pull request #298380 from mweinelt/escapeSystemdExecArg-derivation

nixos/lib: Support derivations in escapeSystemdExecArg
This commit is contained in:
Martin Weinelt 2024-03-23 16:20:00 +01:00 committed by GitHub
commit 790aa81418
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View File

@ -64,8 +64,8 @@ rec {
let
s = if builtins.isPath arg then "${arg}"
else if builtins.isString arg then arg
else if builtins.isInt arg || builtins.isFloat arg then toString arg
else throw "escapeSystemdExecArg only allows strings, paths and numbers";
else if builtins.isInt arg || builtins.isFloat arg || lib.isDerivation arg then toString arg
else throw "escapeSystemdExecArg only allows strings, paths, numbers and derivations";
in
replaceStrings [ "%" "$" ] [ "%%" "$$" ] (builtins.toJSON s);

View File

@ -87,7 +87,6 @@ stdenv.mkDerivation rec {
passthru.tests = {
kea = nixosTests.kea;
prefix-delegation = nixosTests.systemd-networkd-ipv6-prefix-delegation;
prometheus-exporter = nixosTests.prometheus-exporters.kea;
networking-scripted = lib.recurseIntoAttrs { inherit (nixosTests.networking.scripted) dhcpDefault dhcpSimple dhcpOneIf; };
networking-networkd = lib.recurseIntoAttrs { inherit (nixosTests.networking.networkd) dhcpDefault dhcpSimple dhcpOneIf; };
};