From 349b2c66a9e667b2a0f9cbca36fd0acf4c1cae46 Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Wed, 27 Aug 2025 12:47:51 -0600 Subject: [PATCH] `apply` should return `null` if the argument is not a list Fixes https://github.com/nix-darwin/nix-darwin/issues/1578 --- modules/launchd/launchd.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/launchd/launchd.nix b/modules/launchd/launchd.nix index 8499e25..3077981 100644 --- a/modules/launchd/launchd.nix +++ b/modules/launchd/launchd.nix @@ -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 {