From 296e8ea59b876ed2a6e5f83eb38456069f2cc3cf Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 28 Jul 2024 10:47:08 +0800 Subject: [PATCH] wrapper-manager-fds/modules: allow envvar values to be non-escaped --- modules/wrapper-manager/base.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/wrapper-manager/base.nix b/modules/wrapper-manager/base.nix index e8c8b79..b0907cf 100644 --- a/modules/wrapper-manager/base.nix +++ b/modules/wrapper-manager/base.nix @@ -31,6 +31,10 @@ let ''; example = "HELLO THERE"; }; + + isEscaped = lib.mkEnableOption "escaping of the value" // { + default = true; + }; }; }; in @@ -143,7 +147,7 @@ let (n: v: if v.action == "unset" 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) ++ (builtins.map (v: "--add-flags ${lib.escapeShellArg v}") config.prependArgs) ++ (builtins.map (v: "--append-flags ${lib.escapeShellArg v}") config.appendArgs)