nixos/lib: Support derivations in escapeSystemdExecArg
They can be transformed into their outpath string, which is useful for config generators.
This commit is contained in:
@@ -64,8 +64,8 @@ rec {
|
|||||||
let
|
let
|
||||||
s = if builtins.isPath arg then "${arg}"
|
s = if builtins.isPath arg then "${arg}"
|
||||||
else if builtins.isString arg then arg
|
else if builtins.isString arg then arg
|
||||||
else if builtins.isInt arg || builtins.isFloat arg then toString arg
|
else if builtins.isInt arg || builtins.isFloat arg || lib.isDerivation arg then toString arg
|
||||||
else throw "escapeSystemdExecArg only allows strings, paths and numbers";
|
else throw "escapeSystemdExecArg only allows strings, paths, numbers and derivations";
|
||||||
in
|
in
|
||||||
replaceStrings [ "%" "$" ] [ "%%" "$$" ] (builtins.toJSON s);
|
replaceStrings [ "%" "$" ] [ "%%" "$$" ] (builtins.toJSON s);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user