From f959b8878b2a2e27f2df024930e52cb68b0528be Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 15 Jan 2025 17:15:49 +0000 Subject: [PATCH] defaults-write: fix activation script conditionalization These are lists, not attribute sets, so the condition was always succeeding. As far as I can tell this bug has been present since the function was added. --- modules/system/defaults-write.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/system/defaults-write.nix b/modules/system/defaults-write.nix index 22657219..a00b0e42 100644 --- a/modules/system/defaults-write.nix +++ b/modules/system/defaults-write.nix @@ -42,7 +42,7 @@ let CustomSystemPreferences = flatten (mapAttrsToList (name: value: defaultsToList name value) cfg.CustomSystemPreferences); - mkIfAttrs = list: mkIf (any (attrs: attrs != { }) list); + mkIfLists = list: mkIf (any (attrs: attrs != [ ]) list); in { @@ -57,7 +57,7 @@ in else types.float.check x; }; - system.activationScripts.defaults.text = mkIfAttrs [ + system.activationScripts.defaults.text = mkIfLists [ alf loginwindow smb @@ -74,7 +74,7 @@ in ${concatStringsSep "\n" CustomSystemPreferences} ''; - system.activationScripts.userDefaults.text = mkIfAttrs + system.activationScripts.userDefaults.text = mkIfLists [ GlobalPreferences LaunchServices