1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-06 08:47:00 +00:00

Merge pull request #1272 from emilazy/push-uooytqlwsquo

defaults-write: fix activation script conditionalization
This commit is contained in:
Emily 2025-01-17 03:41:37 +00:00 committed by GitHub
commit 09414c7e2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -42,7 +42,7 @@ let
CustomSystemPreferences = flatten (mapAttrsToList (name: value: defaultsToList name value) cfg.CustomSystemPreferences); 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 in
{ {
@ -57,7 +57,7 @@ in
else types.float.check x; else types.float.check x;
}; };
system.activationScripts.defaults.text = mkIfAttrs [ system.activationScripts.defaults.text = mkIfLists [
alf alf
loginwindow loginwindow
smb smb
@ -74,7 +74,7 @@ in
${concatStringsSep "\n" CustomSystemPreferences} ${concatStringsSep "\n" CustomSystemPreferences}
''; '';
system.activationScripts.userDefaults.text = mkIfAttrs system.activationScripts.userDefaults.text = mkIfLists
[ [
GlobalPreferences GlobalPreferences
LaunchServices LaunchServices