wrapper-manager-fds/modules: add unset option

This commit is contained in:
Gabriel Arazas 2024-07-02 11:56:26 +08:00
parent 6e915c34b2
commit f1d4984921
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
2 changed files with 10 additions and 0 deletions

View File

@ -64,6 +64,15 @@ in
};
};
unset = lib.mkOption {
type = with lib.types; listOf nonEmptyStr;
description = ''
A list of environment variables to be unset into the wrapper script.
'';
default = [ ];
example = [ "NO_COLOR" ];
};
executableName = lib.mkOption {
type = lib.types.nonEmptyStr;
description = ''

View File

@ -63,6 +63,7 @@
"--argv0" (config.executableName or config.arg0)
]
++ (lib.mapAttrsToList (n: v: "--set ${n} ${v}") config.env)
++ (builtins.map (v: "--unset ${v}") config.unset)
++ (builtins.map (v: "--prefix 'PATH' ':' ${lib.escapeShellArg v}") config.pathAdd)
++ (builtins.map (v: "--add-flags ${v}") config.prependArgs)
++ (builtins.map (v: "--append-flags ${v}") config.appendArgs)