diff options
author | Martin Weinelt <hexa@darmstadt.ccc.de> | 2024-03-23 15:59:50 +0100 |
---|---|---|
committer | Martin Weinelt <hexa@darmstadt.ccc.de> | 2024-03-23 15:59:50 +0100 |
commit | a4b6e457b8cef338277a4059aecabec0e120b0f2 (patch) | |
tree | c63f1453bfae7aca19b03487691d2999bc92c3af /nixos | |
parent | 4f08de1c5cc048ece9eb84a298781efac132abb8 (diff) |
nixos/lib: Support derivations in escapeSystemdExecArg
They can be transformed into their outpath string, which is useful for config generators.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/lib/utils.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/lib/utils.nix b/nixos/lib/utils.nix index 49ba2e5c83868..22a2c79843c66 100644 --- a/nixos/lib/utils.nix +++ b/nixos/lib/utils.nix @@ -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); |