wrapper-manager-fds/modules: allow envvar values to be non-escaped

This commit is contained in:
Gabriel Arazas 2024-07-28 10:47:08 +08:00
parent f6d80a44d1
commit 72ecef6e69
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360

View File

@ -31,6 +31,10 @@ let
''; '';
example = "HELLO THERE"; example = "HELLO THERE";
}; };
isEscaped = lib.mkEnableOption "escaping of the value" // {
default = true;
};
}; };
}; };
in in
@ -143,7 +147,7 @@ let
(n: v: (n: v:
if v.action == "unset" if v.action == "unset"
then "--${v.action} ${lib.escapeShellArg n}" then "--${v.action} ${lib.escapeShellArg n}"
else "--${v.action} ${lib.escapeShellArg n} ${lib.escapeShellArg v.value}") else "--${v.action} ${lib.escapeShellArg n} ${if v.isEscaped then lib.escapeShellArg v.value else v.value}")
config.env) config.env)
++ (builtins.map (v: "--add-flags ${lib.escapeShellArg v}") config.prependArgs) ++ (builtins.map (v: "--add-flags ${lib.escapeShellArg v}") config.prependArgs)
++ (builtins.map (v: "--append-flags ${lib.escapeShellArg v}") config.appendArgs) ++ (builtins.map (v: "--append-flags ${lib.escapeShellArg v}") config.appendArgs)