From 800754d4d6f4b93e9efc13ed2ba7203a9b240035 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 12 Aug 2025 10:46:55 -0700 Subject: profiles for darwin --- .../aarch64-darwin/HQ-KWNY2VH41P/default.nix | 4 +- machines/darwin/aarch64-darwin/mba-m2/default.nix | 4 +- profiles/darwin.nix | 93 ---------------------- profiles/darwin/desktop.nix | 30 +++++++ profiles/darwin/keyboard.nix | 7 ++ profiles/darwin/nix.nix | 42 ++++++++++ 6 files changed, 85 insertions(+), 95 deletions(-) delete mode 100644 profiles/darwin.nix create mode 100644 profiles/darwin/desktop.nix create mode 100644 profiles/darwin/keyboard.nix create mode 100644 profiles/darwin/nix.nix diff --git a/machines/darwin/aarch64-darwin/HQ-KWNY2VH41P/default.nix b/machines/darwin/aarch64-darwin/HQ-KWNY2VH41P/default.nix index ff58357..17d09dc 100644 --- a/machines/darwin/aarch64-darwin/HQ-KWNY2VH41P/default.nix +++ b/machines/darwin/aarch64-darwin/HQ-KWNY2VH41P/default.nix @@ -8,7 +8,9 @@ imports = [ "${self}/profiles/home-manager.nix" - "${self}/profiles/darwin.nix" + "${self}/profiles/darwin/desktop.nix" + "${self}/profiles/darwin/keyboard.nix" + "${self}/profiles/darwin/nix.nix" "${self}/profiles/darwin/security.nix" "${self}/profiles/desktop/fonts.nix" ]; diff --git a/machines/darwin/aarch64-darwin/mba-m2/default.nix b/machines/darwin/aarch64-darwin/mba-m2/default.nix index 8bb15c8..28b6834 100644 --- a/machines/darwin/aarch64-darwin/mba-m2/default.nix +++ b/machines/darwin/aarch64-darwin/mba-m2/default.nix @@ -16,8 +16,10 @@ imports = [ "${self}/profiles/home-manager.nix" - "${self}/profiles/darwin.nix" "${self}/profiles/nix/remote-builder.nix" + "${self}/profiles/darwin/desktop.nix" + "${self}/profiles/darwin/keyboard.nix" + "${self}/profiles/darwin/nix.nix" "${self}/profiles/darwin/security.nix" "${self}/profiles/desktop/fonts.nix" ]; diff --git a/profiles/darwin.nix b/profiles/darwin.nix deleted file mode 100644 index 36010c7..0000000 --- a/profiles/darwin.nix +++ /dev/null @@ -1,93 +0,0 @@ -{ - adminUser, - pkgs, - lib, - ... -}: -{ - system.defaults = { - dock = { - autohide = true; - dashboard-in-overlay = false; - launchanim = false; # Don't animate opening applications. - mru-spaces = false; # don’t rearrange spaces based on the most recent use - orientation = "left"; - show-recents = false; - showhidden = false; - tilesize = 60; # Default is 64. - wvous-br-corner = 1; # Disable Notes hot corner. - }; - finder.AppleShowAllExtensions = true; - - CustomUserPreferences = { - "com.apple.desktopservices" = { - # Avoid creating .DS_Store files on network or USB volumes - DSDontWriteNetworkStores = true; - DSDontWriteUSBStores = true; - }; - }; - - # Requires the directory to already exist. - # See system.activationScripts.postUserActivation - screencapture.location = "~/Documents/screenshots"; - SoftwareUpdate.AutomaticallyInstallMacOSUpdates = true; - }; - - system.keyboard = { - enableKeyMapping = true; - remapCapsLockToControl = true; - }; - - # TODO: - The `system.activationScripts.postUserActivation` option has - # been removed, as all activation now takes place as `root`. Please - # restructure your custom activation scripts appropriately, - # potentially using `sudo` if you need to run commands as a user. - # system.activationScripts.postUserActivation.text = '' - # mkdir -p ~/Documents/screenshots - # ''; - - nix = { - extraOptions = '' - tarball-ttl = 900 - ''; - gc = { - automatic = true; - options = "--delete-older-than 7d"; - interval = { - Weekday = 0; - Hour = 0; - Minute = 0; - }; - }; - optimise = { - automatic = true; - interval = { - Weekday = 0; - Hour = 0; - Minute = 0; - }; - }; - package = pkgs.nixVersions.stable; - settings = { - trusted-substituters = [ - "https://cachix.cachix.org" - "https://nixpkgs.cachix.org" - "https://nix-community.cachix.org" - ]; - trusted-public-keys = [ - "cachix.cachix.org-1:eWNHQldwUO7G2VkjpnjDbWwy4KQ/HNxht7H4SSoMckM=" - "nixpkgs.cachix.org-1:q91R6hxbwFvDqTSDKwDAV4T5PxqXGxswD8vhONFMeOE=" - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - ]; - trusted-users = [ - "@admin" - adminUser.name - ]; - experimental-features = lib.mkDefault [ - "nix-command" - "flakes" - ]; - }; - }; -} diff --git a/profiles/darwin/desktop.nix b/profiles/darwin/desktop.nix new file mode 100644 index 0000000..a689fac --- /dev/null +++ b/profiles/darwin/desktop.nix @@ -0,0 +1,30 @@ +{ ... }: +{ + system.defaults = { + dock = { + autohide = true; + dashboard-in-overlay = false; + launchanim = false; # Don't animate opening applications. + mru-spaces = false; # don’t rearrange spaces based on the most recent use + orientation = "left"; + show-recents = false; + showhidden = false; + tilesize = 60; # Default is 64. + wvous-br-corner = 1; # Disable Notes hot corner. + }; + finder.AppleShowAllExtensions = true; + + CustomUserPreferences = { + "com.apple.desktopservices" = { + # Avoid creating .DS_Store files on network or USB volumes + DSDontWriteNetworkStores = true; + DSDontWriteUSBStores = true; + }; + }; + + # Requires the directory to already exist. + # See system.activationScripts.postUserActivation + screencapture.location = "~/Documents/screenshots"; + SoftwareUpdate.AutomaticallyInstallMacOSUpdates = true; + }; +} diff --git a/profiles/darwin/keyboard.nix b/profiles/darwin/keyboard.nix new file mode 100644 index 0000000..c460bac --- /dev/null +++ b/profiles/darwin/keyboard.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + system.keyboard = { + enableKeyMapping = true; + remapCapsLockToControl = true; + }; +} diff --git a/profiles/darwin/nix.nix b/profiles/darwin/nix.nix new file mode 100644 index 0000000..56d85ca --- /dev/null +++ b/profiles/darwin/nix.nix @@ -0,0 +1,42 @@ +{ + lib, + adminUser, + pkgs, + ... +}: +{ + nix = { + extraOptions = '' + tarball-ttl = 900 + ''; + gc = { + automatic = true; + options = "--delete-older-than 7d"; + }; + optimise = { + automatic = true; + }; + package = pkgs.nixVersions.stable; + settings = { + trusted-substituters = [ + "https://cachix.cachix.org" + "https://nixpkgs.cachix.org" + "https://nix-community.cachix.org" + ]; + trusted-public-keys = [ + "cachix.cachix.org-1:eWNHQldwUO7G2VkjpnjDbWwy4KQ/HNxht7H4SSoMckM=" + "nixpkgs.cachix.org-1:q91R6hxbwFvDqTSDKwDAV4T5PxqXGxswD8vhONFMeOE=" + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + trusted-users = [ + "@admin" + adminUser.name + ]; + experimental-features = lib.mkDefault [ + "nix-command" + "flakes" + ]; + }; + }; +} -- cgit v1.2.3