From 13c76e23d1f50c08579d4e0ac85c82ef1815445c Mon Sep 17 00:00:00 2001 From: Dennis Date: Tue, 3 Mar 2026 14:54:49 +0100 Subject: [PATCH] moves darwin system config to module --- flake.lock | 180 +++++++++++++++++++++++++++++++++++++ modules/darwin-system.nix | 65 ++++++++++++++ modules/hosts/dnsc-air.nix | 1 + 3 files changed, 246 insertions(+) create mode 100644 flake.lock create mode 100644 modules/darwin-system.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..91194c1 --- /dev/null +++ b/flake.lock @@ -0,0 +1,180 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs-lib" + ] + }, + "locked": { + "lastModified": 1772408722, + "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1769996383, + "narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "57928607ea566b5db3ad13af0e57e921e6b12381", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772516620, + "narHash": "sha256-2r4cKdqCVlQkvcTcLUMxmsmAYZZxCMd//w/PnDnukTE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "2b9504d5a0169d4940a312abe2df2c5658db8de9", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "import-tree": { + "locked": { + "lastModified": 1772344373, + "narHash": "sha256-OQQ1MhB9t1J71b2wxRRTdH/Qd8UGG0p+dGspfCf5U1c=", + "owner": "vic", + "repo": "import-tree", + "rev": "10fda59eee7d7970ec443b925f32a1bc7526648c", + "type": "github" + }, + "original": { + "owner": "vic", + "repo": "import-tree", + "type": "github" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772379624, + "narHash": "sha256-NG9LLTWlz4YiaTAiRGChbrzbVxBfX+Auq4Ab/SWmk4A=", + "owner": "LnL7", + "repo": "nix-darwin", + "rev": "52d061516108769656a8bd9c6e811c677ec5b462", + "type": "github" + }, + "original": { + "owner": "LnL7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1772479524, + "narHash": "sha256-U+hMRvavBzJYhdWCWGRHCK3bpcKjqTJAnyii3y09uT8=", + "rev": "4215e62dc2cd3bc705b0a423b9719ff6be378a43", + "type": "tarball", + "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre957146.4215e62dc2cd/nixexprs.tar.xz" + }, + "original": { + "type": "tarball", + "url": "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1770380644, + "narHash": "sha256-P7dWMHRUWG5m4G+06jDyThXO7kwSk46C1kgjEWcybkE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ae67888ff7ef9dff69b3cf0cc0fbfbcd3a722abe", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixvim": { + "inputs": { + "flake-parts": "flake-parts_2", + "nixpkgs": "nixpkgs_2", + "systems": "systems" + }, + "locked": { + "lastModified": 1772402258, + "narHash": "sha256-3DmCFOdmbkFML1/G9gj8Wb+rCCZFPOQtNoMCpqOF8SA=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "21ae25e13b01d3b4cdc750b5f9e7bad68b150c10", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "home-manager": "home-manager", + "import-tree": "import-tree", + "nix-darwin": "nix-darwin", + "nixpkgs": "nixpkgs", + "nixpkgs-lib": [ + "nixpkgs" + ], + "nixvim": "nixvim" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/modules/darwin-system.nix b/modules/darwin-system.nix new file mode 100644 index 0000000..3f96cf2 --- /dev/null +++ b/modules/darwin-system.nix @@ -0,0 +1,65 @@ +{ config, ... }: +let + username = config.flake.globalConfig.username; +in +{ + flake.modules.darwin.system = { + system = { + primaryUser = username; + stateVersion = 5; + activationScripts.postActivation.text = '' + /System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u + ''; + + defaults = { + NSGlobalDomain."com.apple.swipescrolldirection" = false; + + dock = { + autohide = true; + autohide-delay = 0.01; + autohide-time-modifier = 0.01; + expose-group-apps = true; + launchanim = false; + minimize-to-application = true; + orientation = "right"; + show-recents = false; + persistent-apps = [ + "/Applications/Helium.app" + "/Applications/Ghostty.app" + "/System/Applications/System Settings.app/" + ]; + persistent-others = [ + "/Users/${username}/Downloads" + ]; + }; + + finder = { + AppleShowAllExtensions = true; + CreateDesktop = false; + FXEnableExtensionChangeWarning = false; + FXPreferredViewStyle = "clmv"; + ShowPathbar = true; + ShowStatusBar = true; + }; + + loginwindow = { + LoginwindowText = "(λ) powered by nix-darwin"; + }; + + menuExtraClock = { + Show24Hour = true; + ShowDate = 0; + }; + + screencapture = { + location = "/Users/${username}/Downloads"; + target = "file"; + }; + + spaces.spans-displays = false; + }; + }; + + security.pam.services.sudo_local.touchIdAuth = true; + }; +} diff --git a/modules/hosts/dnsc-air.nix b/modules/hosts/dnsc-air.nix index 3da8700..8784c24 100644 --- a/modules/hosts/dnsc-air.nix +++ b/modules/hosts/dnsc-air.nix @@ -12,6 +12,7 @@ in specialArgs = { inherit inputs; }; modules = [ inputs.home-manager.darwinModules.home-manager + config.flake.modules.darwin.system { networking.hostName = "dnsc-air"; networking.computerName = "dnsc-air";