apply should return null if the argument is not a list

Fixes https://github.com/nix-darwin/nix-darwin/issues/1578
This commit is contained in:
Nathan Henrie 2025-08-27 12:47:51 -06:00
parent 8df64f8196
commit 349b2c66a9

View file

@ -121,7 +121,17 @@ in
key. Please note: many people are confused by this key. Please read `execvp(3)` very carefully!
'';
# TODO: Remove this some time after 25.11.
apply = map (value: lib.warnIf (lib.hasInfix "&" value) "A value for `ProgramArguments` contains the literal string `&`. This is no longer necessary and will lead to double-escaping, as nix-darwin now automatically escapes special characters." value);
apply =
val:
if (builtins.isNull val) then
val
else
(map (
item:
lib.warnIf (lib.hasInfix "&" item)
"A value for `ProgramArguments` contains the literal string `&`. This is no longer necessary and will lead to double-escaping, as nix-darwin now automatically escapes special characters."
item
) val);
};
EnableGlobbing = mkOption {