From 7000d01f6b01156995ea4157729381423f2318ea Mon Sep 17 00:00:00 2001 From: Niccolo Borgioli Date: Wed, 15 Jan 2025 19:04:48 +0100 Subject: [PATCH] add some macos config --- README.md | 2 +- flake.nix | 26 +++++++++++++++++++++++--- home.nix | 2 +- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8268cdb..b48e6e0 100644 --- a/README.md +++ b/README.md @@ -13,5 +13,5 @@ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix git clone https://github.com/cupcakearmy/nix-macos ~/.config/nix-darwin # Installation -nix run nix-darwin -- switch --flake ~/.config/nix-darwin#sflx +nix run nix-darwin -- switch --flake ~/.config/nix-darwin#mbp ``` diff --git a/flake.nix b/flake.nix index d347df9..fae05d2 100644 --- a/flake.nix +++ b/flake.nix @@ -37,9 +37,25 @@ # https://daiderd.com/nix-darwin/manual/index.html environment.systemPackages = [ ]; + # Security + system.defaults.screensaver.askForPassword = true; + system.defaults.screensaver.askForPasswordDelay = 0; + system.defaults.loginwindow.GuestEnabled = false; + + # Dock system.defaults.dock.autohide = true; system.defaults.dock.orientation = "left"; - system.defaults.finder.AppleShowAllExtensions = true; + system.defaults.dock.show-recents = false; + system.defaults.dock.persistent-apps = [ + "/Applications/Arc.app" + "/Applications/Ghostty.app" + "/Applications/VSCodium.app" + "/Applications/Spotify.app" + "/System/Applications/System Settings.app" + ]; + system.defaults.dock.persistent-others = [ ]; + + # Input devices system.keyboard.enableKeyMapping = true; system.keyboard.remapCapsLockToEscape = true; system.defaults.NSGlobalDomain.InitialKeyRepeat = 25; @@ -48,6 +64,10 @@ system.defaults.NSGlobalDomain."com.apple.trackpad.scaling" = 0.875; system.defaults.trackpad.Dragging = true; + # Finder + system.defaults.finder.AppleShowAllExtensions = true; + system.defaults.finder.ShowPathbar = true; + users.users."niccoloborgioli" = { home = "/Users/niccoloborgioli"; shell = pkgs.fish; @@ -67,7 +87,7 @@ { # Build darwin flake using: # $ darwin-rebuild build --flake .#Niccolo-Borgioli-s-MacBook-Pro - darwinConfigurations."sflx" = nix-darwin.lib.darwinSystem { + darwinConfigurations."mbp" = nix-darwin.lib.darwinSystem { modules = [ configuration home-manager.darwinModules.home-manager @@ -80,6 +100,6 @@ }; # Expose the package set, including overlays, for convenience. - darwinPackages = self.darwinConfigurations."sflx".pkgs; + darwinPackages = self.darwinConfigurations."mbp".pkgs; }; } diff --git a/home.nix b/home.nix index 49ab514..f456b54 100644 --- a/home.nix +++ b/home.nix @@ -85,7 +85,7 @@ t = "tmux new-session -A -s main"; e = "nvim"; hms = "home-manager switch --flake ~/nix#root -b backup"; - snd = "darwin-rebuild switch --flake ~/.config/nix-darwin#sflx"; + snd = "darwin-rebuild switch --flake ~/.config/nix-darwin#mpb"; }; programs.fish = {