1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-05 16:27:03 +00:00

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.
This commit is contained in:
Emily 2025-01-15 17:15:49 +00:00
parent bd921223ba
commit f959b8878b

View file

@ -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