Kieran's opinionated (and probably slightly dumb) nix config
at main 5.4 kB view raw
1{ 2 inputs, 3 pkgs, 4 ... 5}: 6{ 7 imports = [ 8 ./home-manager.nix 9 ]; 10 11 # Set host platform for Apple Silicon 12 nixpkgs = { 13 hostPlatform = "aarch64-darwin"; 14 config = { 15 allowUnfree = true; 16 }; 17 }; 18 19 # Enable nix-darwin 20 nix.settings.experimental-features = [ 21 "nix-command" 22 "flakes" 23 ]; 24 25 # switch to lix 26 nix.package = pkgs.lixPackageSets.stable.lix; 27 28 # Set hostname 29 networking.hostName = "atalanta"; 30 31 # Define user 32 users.users.kierank = { 33 name = "kierank"; 34 home = "/Users/kierank"; 35 }; 36 37 system.primaryUser = "kierank"; 38 39 ids.gids.nixbld = 350; 40 41 # Install packages 42 environment.systemPackages = [ 43 # nix stuff 44 pkgs.nixd 45 pkgs.nil 46 pkgs.nixfmt-rfc-style 47 inputs.agenix.packages.aarch64-darwin.default 48 # dev_langs 49 pkgs.nodejs_22 50 pkgs.unstable.bun 51 pkgs.python3 52 pkgs.go 53 pkgs.gopls 54 pkgs.gotools 55 pkgs.go-tools 56 pkgs.gcc 57 pkgs.rustc 58 pkgs.cargo 59 pkgs.jdk 60 pkgs.ruby 61 pkgs.cmake 62 pkgs.unstable.biome 63 pkgs.unstable.apktool 64 pkgs.nodePackages_latest.prisma 65 pkgs.unstable.zola 66 pkgs.mill 67 pkgs.clang 68 pkgs.clang-tools 69 pkgs.ninja 70 # tools 71 pkgs.calc 72 pkgs.nh 73 pkgs.rustscan 74 pkgs.vhs 75 inputs.soapdump.packages.${pkgs.stdenv.hostPlatform.system}.default 76 ]; 77 78 programs.direnv.enable = true; 79 80 # import the secret 81 age.identityPaths = [ 82 "/Users/kierank/.ssh/id_rsa" 83 ]; 84 age.secrets = { 85 wakatime = { 86 file = ../../secrets/wakatime.age; 87 path = "/Users/kierank/.wakatime.cfg"; 88 owner = "kierank"; 89 }; 90 bluesky = { 91 file = ../../secrets/bluesky.age; 92 owner = "kierank"; 93 }; 94 crush = { 95 file = ../../secrets/crush.age; 96 owner = "kierank"; 97 }; 98 context7 = { 99 file = ../../secrets/context7.age; 100 owner = "kierank"; 101 }; 102 frp-auth-token = { 103 file = ../../secrets/frp-auth-token.age; 104 owner = "kierank"; 105 }; 106 }; 107 108 environment.variables = { 109 EDITOR = "nvim"; 110 SYSTEMD_EDITOR = "nvim"; 111 VISUAL = "nvim"; 112 }; 113 114 # nothing but finder in the doc 115 system.defaults.dock = { 116 persistent-apps = [ ]; 117 118 tilesize = 47; 119 show-recents = false; 120 }; 121 122 # allow using apple watch or touch id for sudo 123 security.pam.services.sudo_local.touchIdAuth = true; 124 security.pam.services.sudo_local.watchIdAuth = true; 125 126 system.defaults = { 127 finder.FXPreferredViewStyle = "Nlsv"; 128 finder.AppleShowAllExtensions = true; 129 # expand the save dialogs 130 NSGlobalDomain.NSNavPanelExpandedStateForSaveMode = true; 131 NSGlobalDomain.NSNavPanelExpandedStateForSaveMode2 = true; 132 LaunchServices.LSQuarantine = false; # disables "Are you sure?" for new apps 133 loginwindow.GuestEnabled = false; 134 135 NSGlobalDomain."com.apple.trackpad.scaling" = 0.875; 136 137 CustomSystemPreferences = { 138 "com.apple.DiskArbitration.diskarbitrationd" = { 139 DADisableEjectNotification = true; 140 }; 141 }; 142 143 CustomUserPreferences = { 144 "com.apple.driver.AppleBluetoothMultitouch.mouse" = { 145 MouseButtonMode = "TwoButton"; 146 }; 147 "com.apple.WindowManager" = { 148 EnableTiledWindowMargins = false; 149 }; 150 "com.apple.desktopservices" = { 151 # Avoid creating .DS_Store files on network or USB volumes 152 DSDontWriteNetworkStores = true; 153 DSDontWriteUSBStores = true; 154 }; 155 "com.apple.AdLib" = { 156 allowApplePersonalizedAdvertising = false; 157 }; 158 "com.apple.SoftwareUpdate" = { 159 AutomaticCheckEnabled = true; 160 # Check for software updates daily, not just once per week 161 ScheduleFrequency = 1; 162 # Download newly available updates in background 163 AutomaticDownload = 1; 164 # Install System data files & security updates 165 CriticalUpdateInstall = 1; 166 }; 167 # keybindings 168 # Script to export symbolic hotkey configs from MacOS 169 # https://gist.github.com/sawadashota/8e7ce32234e0f07a03e955f22ec4c0f9 170 # Screenshot selected area to file with Cmd+Option+Shift+4 171 "com.apple.symbolichotkeys" = { 172 AppleSymbolicHotKeys = { 173 # Screenshot selected area with Option+Cmd+Shift+4 174 "30" = { 175 enabled = true; 176 value = { 177 parameters = [ 178 52 179 21 180 1703936 181 ]; 182 type = "standard"; 183 }; 184 }; 185 # Screenshot selected area to clipboard with Cmd+Shift+4 186 "31" = { 187 enabled = true; 188 value = { 189 parameters = [ 190 52 191 21 192 1179648 193 ]; 194 type = "standard"; 195 }; 196 }; 197 # Fullscreen screenshot Option+Cmd+Shift+3 198 "28" = { 199 enabled = true; 200 value = { 201 parameters = [ 202 51 203 20 204 1703936 205 ]; 206 type = "standard"; 207 }; 208 }; 209 # Fullscreen screenshot to clipboard Cmd+Shift+3 210 "29" = { 211 enabled = true; 212 value = { 213 parameters = [ 214 51 215 20 216 1179648 217 ]; 218 type = "standard"; 219 }; 220 }; 221 }; 222 }; 223 }; 224 }; 225 226 # Used for backwards compatibility, please read the changelog before changing 227 system.stateVersion = 4; 228}