Configuration for my NixOS based systems and Home Manager

Simplify flake

+486 -100
+2 -31
configuration.nix
··· 1 - # Edit this configuration file to define what should be installed on 2 - # your system. Help is available in the configuration.nix(5) man page, on 3 - # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). 4 - 5 - # NixOS-WSL specific options are documented on the NixOS-WSL repository: 6 - # https://github.com/nix-community/NixOS-WSL 7 - 8 - { ... }: { 9 - imports = [ 10 - # WSL has no hardware configuration 11 - #./hardware-configuration.nix 12 - #./boot.nix 13 - ./networking.nix 14 - #./gui.nix 15 - ./users.nix 16 - ./packages.nix 17 - ./services.nix 18 - # include NixOS-WSL modules 19 - <nixos-wsl/modules> 20 - ]; 21 - wsl = { 22 - enable = true; 23 - defaultUser = "noah"; 24 - wslConf.network.hostname = "touma-wsl-nixos"; 25 - }; 26 - 1 + { ... }: 2 + { 27 3 # Set your time zone. 28 4 time.timeZone = "America/Chicago"; 29 5 ··· 34 10 # keyMap = "us"; 35 11 # useXkbConfig = true; # use xkb.options in tty. 36 12 # }; 37 - 38 - # Copy the NixOS configuration file and link it from the resulting system 39 - # (/run/current-system/configuration.nix). This is useful in case you 40 - # accidentally delete configuration.nix. 41 - system.copySystemConfiguration = true; 42 13 43 14 # Automatic doc cache generation 44 15 documentation.man.generateCaches = true;
+349 -10
flake.lock
··· 1 1 { 2 2 "nodes": { 3 + "agenix": { 4 + "inputs": { 5 + "darwin": "darwin", 6 + "home-manager": "home-manager", 7 + "nixpkgs": "nixpkgs", 8 + "systems": "systems" 9 + }, 10 + "locked": { 11 + "lastModified": 1762618334, 12 + "narHash": "sha256-wyT7Pl6tMFbFrs8Lk/TlEs81N6L+VSybPfiIgzU8lbQ=", 13 + "owner": "ryantm", 14 + "repo": "agenix", 15 + "rev": "fcdea223397448d35d9b31f798479227e80183f6", 16 + "type": "github" 17 + }, 18 + "original": { 19 + "owner": "ryantm", 20 + "repo": "agenix", 21 + "type": "github" 22 + } 23 + }, 24 + "darwin": { 25 + "inputs": { 26 + "nixpkgs": [ 27 + "agenix", 28 + "nixpkgs" 29 + ] 30 + }, 31 + "locked": { 32 + "lastModified": 1744478979, 33 + "narHash": "sha256-dyN+teG9G82G+m+PX/aSAagkC+vUv0SgUw3XkPhQodQ=", 34 + "owner": "lnl7", 35 + "repo": "nix-darwin", 36 + "rev": "43975d782b418ebf4969e9ccba82466728c2851b", 37 + "type": "github" 38 + }, 39 + "original": { 40 + "owner": "lnl7", 41 + "ref": "master", 42 + "repo": "nix-darwin", 43 + "type": "github" 44 + } 45 + }, 46 + "determinate-nixd-aarch64-darwin": { 47 + "flake": false, 48 + "locked": { 49 + "narHash": "sha256-g1r0dPwlUi1h96c4BuHzv9M2lWDqRy9bPDW9tRSq35I=", 50 + "type": "file", 51 + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.13.2/macOS" 52 + }, 53 + "original": { 54 + "type": "file", 55 + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.13.2/macOS" 56 + } 57 + }, 58 + "determinate-nixd-aarch64-linux": { 59 + "flake": false, 60 + "locked": { 61 + "narHash": "sha256-xn324irXG/EpUdUfUGFrlJNg23JN2cVArd5LsFPjGKc=", 62 + "type": "file", 63 + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.13.2/aarch64-linux" 64 + }, 65 + "original": { 66 + "type": "file", 67 + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.13.2/aarch64-linux" 68 + } 69 + }, 70 + "determinate-nixd-x86_64-linux": { 71 + "flake": false, 72 + "locked": { 73 + "narHash": "sha256-VPM5FOGwEjl56b7Edvg3sduvauPHCyXZ11fN9hcUdTU=", 74 + "type": "file", 75 + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.13.2/x86_64-linux" 76 + }, 77 + "original": { 78 + "type": "file", 79 + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.13.2/x86_64-linux" 80 + } 81 + }, 82 + "determinite": { 83 + "inputs": { 84 + "determinate-nixd-aarch64-darwin": "determinate-nixd-aarch64-darwin", 85 + "determinate-nixd-aarch64-linux": "determinate-nixd-aarch64-linux", 86 + "determinate-nixd-x86_64-linux": "determinate-nixd-x86_64-linux", 87 + "nix": "nix", 88 + "nixpkgs": [ 89 + "nixpkgs" 90 + ] 91 + }, 92 + "locked": { 93 + "lastModified": 1763536872, 94 + "narHash": "sha256-QCYGGghBya+qsY59f1zzgYzxEzz+N9S7YRkVWDIDbgo=", 95 + "rev": "f4e598cbb10021c93f73dd4c0cf01ec791ea53f9", 96 + "revCount": 315, 97 + "type": "tarball", 98 + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/determinate/3.13.2/019a9b01-c0c6-7e1c-959e-98ac5b7675de/source.tar.gz" 99 + }, 100 + "original": { 101 + "type": "tarball", 102 + "url": "https://flakehub.com/f/DeterminateSystems/determinate/3" 103 + } 104 + }, 3 105 "flake-compat": { 4 106 "flake": false, 5 107 "locked": { ··· 16 118 "type": "github" 17 119 } 18 120 }, 121 + "flake-compat_2": { 122 + "flake": false, 123 + "locked": { 124 + "lastModified": 1765121682, 125 + "narHash": "sha256-4VBOP18BFeiPkyhy9o4ssBNQEvfvv1kXkasAYd0+rrA=", 126 + "owner": "edolstra", 127 + "repo": "flake-compat", 128 + "rev": "65f23138d8d09a92e30f1e5c87611b23ef451bf3", 129 + "type": "github" 130 + }, 131 + "original": { 132 + "owner": "edolstra", 133 + "repo": "flake-compat", 134 + "type": "github" 135 + } 136 + }, 137 + "flake-compat_3": { 138 + "flake": false, 139 + "locked": { 140 + "lastModified": 1696426674, 141 + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", 142 + "owner": "edolstra", 143 + "repo": "flake-compat", 144 + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", 145 + "type": "github" 146 + }, 147 + "original": { 148 + "owner": "edolstra", 149 + "repo": "flake-compat", 150 + "type": "github" 151 + } 152 + }, 153 + "flake-parts": { 154 + "inputs": { 155 + "nixpkgs-lib": [ 156 + "determinite", 157 + "nix", 158 + "nixpkgs" 159 + ] 160 + }, 161 + "locked": { 162 + "lastModified": 1748821116, 163 + "narHash": "sha256-F82+gS044J1APL0n4hH50GYdPRv/5JWm34oCJYmVKdE=", 164 + "rev": "49f0870db23e8c1ca0b5259734a02cd9e1e371a1", 165 + "revCount": 377, 166 + "type": "tarball", 167 + "url": "https://api.flakehub.com/f/pinned/hercules-ci/flake-parts/0.1.377%2Brev-49f0870db23e8c1ca0b5259734a02cd9e1e371a1/01972f28-554a-73f8-91f4-d488cc502f08/source.tar.gz" 168 + }, 169 + "original": { 170 + "type": "tarball", 171 + "url": "https://flakehub.com/f/hercules-ci/flake-parts/0.1" 172 + } 173 + }, 174 + "git-hooks-nix": { 175 + "inputs": { 176 + "flake-compat": "flake-compat", 177 + "gitignore": [ 178 + "determinite", 179 + "nix" 180 + ], 181 + "nixpkgs": [ 182 + "determinite", 183 + "nix", 184 + "nixpkgs" 185 + ] 186 + }, 187 + "locked": { 188 + "lastModified": 1747372754, 189 + "narHash": "sha256-2Y53NGIX2vxfie1rOW0Qb86vjRZ7ngizoo+bnXU9D9k=", 190 + "rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46", 191 + "revCount": 1026, 192 + "type": "tarball", 193 + "url": "https://api.flakehub.com/f/pinned/cachix/git-hooks.nix/0.1.1026%2Brev-80479b6ec16fefd9c1db3ea13aeb038c60530f46/0196d79a-1b35-7b8e-a021-c894fb62163d/source.tar.gz" 194 + }, 195 + "original": { 196 + "type": "tarball", 197 + "url": "https://flakehub.com/f/cachix/git-hooks.nix/0.1.941" 198 + } 199 + }, 19 200 "gitignore": { 20 201 "inputs": { 21 202 "nixpkgs": [ ··· 40 221 "home-manager": { 41 222 "inputs": { 42 223 "nixpkgs": [ 224 + "agenix", 225 + "nixpkgs" 226 + ] 227 + }, 228 + "locked": { 229 + "lastModified": 1745494811, 230 + "narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=", 231 + "owner": "nix-community", 232 + "repo": "home-manager", 233 + "rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be", 234 + "type": "github" 235 + }, 236 + "original": { 237 + "owner": "nix-community", 238 + "repo": "home-manager", 239 + "type": "github" 240 + } 241 + }, 242 + "home-manager_2": { 243 + "inputs": { 244 + "nixpkgs": [ 43 245 "nixpkgs" 44 246 ] 45 247 }, ··· 58 260 "type": "github" 59 261 } 60 262 }, 263 + "nix": { 264 + "inputs": { 265 + "flake-parts": "flake-parts", 266 + "git-hooks-nix": "git-hooks-nix", 267 + "nixpkgs": "nixpkgs_2", 268 + "nixpkgs-23-11": "nixpkgs-23-11", 269 + "nixpkgs-regression": "nixpkgs-regression" 270 + }, 271 + "locked": { 272 + "lastModified": 1763534330, 273 + "narHash": "sha256-gTuB2qBdSKCKnZwENTqScs/pPBaZQOv6zZ1KJvV/ohk=", 274 + "rev": "be871f9baf5366a220b5f25634eebab6f452a017", 275 + "revCount": 23278, 276 + "type": "tarball", 277 + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/nix-src/3.13.2/019a9af6-3d7b-71bc-bccd-8b18e147ad77/source.tar.gz" 278 + }, 279 + "original": { 280 + "type": "tarball", 281 + "url": "https://flakehub.com/f/DeterminateSystems/nix-src/%2A" 282 + } 283 + }, 284 + "nixos-wsl": { 285 + "inputs": { 286 + "flake-compat": "flake-compat_2", 287 + "nixpkgs": "nixpkgs_3" 288 + }, 289 + "locked": { 290 + "lastModified": 1765483419, 291 + "narHash": "sha256-w6wznH1lBzlSH3+pWDkE+L6xA0F02drFAzu2E7PD/Jo=", 292 + "owner": "nix-community", 293 + "repo": "NixOS-WSL", 294 + "rev": "0c040f28b44b18e0d4240e027096078e34dbb029", 295 + "type": "github" 296 + }, 297 + "original": { 298 + "owner": "nix-community", 299 + "ref": "main", 300 + "repo": "NixOS-WSL", 301 + "type": "github" 302 + } 303 + }, 61 304 "nixpkgs": { 62 305 "locked": { 63 - "lastModified": 1764522689, 64 - "narHash": "sha256-SqUuBFjhl/kpDiVaKLQBoD8TLD+/cTUzzgVFoaHrkqY=", 65 - "owner": "nixos", 306 + "lastModified": 1754028485, 307 + "narHash": "sha256-IiiXB3BDTi6UqzAZcf2S797hWEPCRZOwyNThJIYhUfk=", 308 + "owner": "NixOS", 309 + "repo": "nixpkgs", 310 + "rev": "59e69648d345d6e8fef86158c555730fa12af9de", 311 + "type": "github" 312 + }, 313 + "original": { 314 + "owner": "NixOS", 315 + "ref": "nixos-25.05", 316 + "repo": "nixpkgs", 317 + "type": "github" 318 + } 319 + }, 320 + "nixpkgs-23-11": { 321 + "locked": { 322 + "lastModified": 1717159533, 323 + "narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=", 324 + "owner": "NixOS", 325 + "repo": "nixpkgs", 326 + "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", 327 + "type": "github" 328 + }, 329 + "original": { 330 + "owner": "NixOS", 331 + "repo": "nixpkgs", 332 + "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", 333 + "type": "github" 334 + } 335 + }, 336 + "nixpkgs-regression": { 337 + "locked": { 338 + "lastModified": 1643052045, 339 + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", 340 + "owner": "NixOS", 66 341 "repo": "nixpkgs", 67 - "rev": "8bb5646e0bed5dbd3ab08c7a7cc15b75ab4e1d0f", 342 + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", 68 343 "type": "github" 69 344 }, 70 345 "original": { 71 - "owner": "nixos", 72 - "ref": "nixos-25.11", 346 + "owner": "NixOS", 73 347 "repo": "nixpkgs", 348 + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", 74 349 "type": "github" 75 350 } 76 351 }, ··· 92 367 }, 93 368 "nixpkgs_2": { 94 369 "locked": { 370 + "lastModified": 1761597516, 371 + "narHash": "sha256-wxX7u6D2rpkJLWkZ2E932SIvDJW8+ON/0Yy8+a5vsDU=", 372 + "rev": "daf6dc47aa4b44791372d6139ab7b25269184d55", 373 + "revCount": 811874, 374 + "type": "tarball", 375 + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2505.811874%2Brev-daf6dc47aa4b44791372d6139ab7b25269184d55/019a3494-3498-707e-9086-1fb81badc7fe/source.tar.gz" 376 + }, 377 + "original": { 378 + "type": "tarball", 379 + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.2505" 380 + } 381 + }, 382 + "nixpkgs_3": { 383 + "locked": { 384 + "lastModified": 1764950072, 385 + "narHash": "sha256-BmPWzogsG2GsXZtlT+MTcAWeDK5hkbGRZTeZNW42fwA=", 386 + "owner": "NixOS", 387 + "repo": "nixpkgs", 388 + "rev": "f61125a668a320878494449750330ca58b78c557", 389 + "type": "github" 390 + }, 391 + "original": { 392 + "owner": "NixOS", 393 + "ref": "nixos-unstable", 394 + "repo": "nixpkgs", 395 + "type": "github" 396 + } 397 + }, 398 + "nixpkgs_4": { 399 + "locked": { 400 + "lastModified": 1764522689, 401 + "narHash": "sha256-SqUuBFjhl/kpDiVaKLQBoD8TLD+/cTUzzgVFoaHrkqY=", 402 + "owner": "nixos", 403 + "repo": "nixpkgs", 404 + "rev": "8bb5646e0bed5dbd3ab08c7a7cc15b75ab4e1d0f", 405 + "type": "github" 406 + }, 407 + "original": { 408 + "owner": "nixos", 409 + "ref": "nixos-25.11", 410 + "repo": "nixpkgs", 411 + "type": "github" 412 + } 413 + }, 414 + "nixpkgs_5": { 415 + "locked": { 95 416 "lastModified": 1730768919, 96 417 "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", 97 418 "owner": "NixOS", ··· 108 429 }, 109 430 "pre-commit-hooks": { 110 431 "inputs": { 111 - "flake-compat": "flake-compat", 432 + "flake-compat": "flake-compat_3", 112 433 "gitignore": "gitignore", 113 - "nixpkgs": "nixpkgs_2" 434 + "nixpkgs": "nixpkgs_5" 114 435 }, 115 436 "locked": { 116 437 "lastModified": 1742649964, ··· 128 449 }, 129 450 "root": { 130 451 "inputs": { 131 - "home-manager": "home-manager", 132 - "nixpkgs": "nixpkgs", 452 + "agenix": "agenix", 453 + "determinite": "determinite", 454 + "home-manager": "home-manager_2", 455 + "nixos-wsl": "nixos-wsl", 456 + "nixpkgs": "nixpkgs_4", 133 457 "nixpkgs-unstable": "nixpkgs-unstable", 134 458 "pre-commit-hooks": "pre-commit-hooks" 459 + } 460 + }, 461 + "systems": { 462 + "locked": { 463 + "lastModified": 1681028828, 464 + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 465 + "owner": "nix-systems", 466 + "repo": "default", 467 + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 468 + "type": "github" 469 + }, 470 + "original": { 471 + "owner": "nix-systems", 472 + "repo": "default", 473 + "type": "github" 135 474 } 136 475 } 137 476 },
+75 -20
flake.nix
··· 1 1 { 2 - description = "Home Manager configuration of noah"; 2 + description = "Home Manager configuration for noah"; 3 3 4 4 inputs = { 5 5 # Specify the source of Home Manager and Nixpkgs. 6 6 nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; 7 7 nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; 8 + nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; 9 + determinite = { 10 + url = "https://flakehub.com/f/DeterminateSystems/determinate/3"; 11 + inputs.nixpkgs.follows = "nixpkgs"; 12 + }; 8 13 home-manager = { 9 14 url = "github:nix-community/home-manager/release-25.11"; 10 15 inputs.nixpkgs.follows = "nixpkgs"; 11 16 }; 12 17 pre-commit-hooks.url = "github:cachix/git-hooks.nix"; 18 + agenix.url = "github:ryantm/agenix"; 13 19 }; 14 20 15 - outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, pre-commit-hooks, ... }@inputs: 21 + outputs = 22 + { 23 + self, 24 + nixpkgs, 25 + nixpkgs-unstable, 26 + nixos-wsl, 27 + determinite, 28 + home-manager, 29 + pre-commit-hooks, 30 + agenix, 31 + ... 32 + }@inputs: 16 33 let 17 - system = "aarch64-darwin"; 18 - pkgs = nixpkgs.legacyPackages.${system}; 19 - unstable-pkgs = nixpkgs-unstable.legacyPackages.${system}; 20 - supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; 34 + supportedSystems = [ 35 + "x86_64-linux" 36 + "aarch64-linux" 37 + "x86_64-darwin" 38 + "aarch64-darwin" 39 + ]; 21 40 forAllSystems = nixpkgs.lib.genAttrs supportedSystems; 41 + basicSystem = 42 + { 43 + system ? "x86_64-linux", 44 + modules ? [ ], 45 + unstable ? false, 46 + ... 47 + }: 48 + inputs.nixpkgs.lib.nixosSystem { 49 + inherit system; 50 + specialArgs = 51 + { 52 + inherit inputs; 53 + } 54 + // nixpkgs.lib.optionalAttrs unstable { 55 + unstable = nixpkgs-unstable.legacyPackages.${system}; 56 + }; 57 + modules = [ 58 + determinite.nixosModules.default 59 + ./configuration.nix 60 + agenix.nixosModules.default 61 + home-manager.nixosModules.home-manager 62 + { 63 + home-manager.useGlobalPkgs = true; 64 + home-manager.useUserPackages = true; 65 + home-manager.users.noah = ./home.nix; 66 + home-manager.extraSpecialArgs = 67 + { 68 + inherit inputs; 69 + } 70 + // nixpkgs.lib.optionalAttrs unstable { 71 + unstable = nixpkgs-unstable.legacyPackages.${system}; 72 + }; 73 + } 74 + ] ++ modules; 75 + }; 22 76 in 23 77 { 24 - homeConfigurations."noah" = home-manager.lib.homeManagerConfiguration { 25 - inherit pkgs; 26 - 27 - # Specify your home configuration modules here, for example, 28 - # the path to your home.nix. 29 - modules = [ ./noah-home.nix ]; 30 - 31 - # Optionally use extraSpecialArgs 32 - # to pass through arguments to home.nix 33 - extraSpecialArgs = { 34 - unstable = unstable-pkgs; 35 - }; 78 + # incomplete 79 + nixosConfigurations.odin = basicSystem { 80 + unstable = true; 81 + }; 82 + nixosConfigurations.touma-wsl = basicSystem { 83 + unstable = true; 84 + modules = [ 85 + ./host-specific/touma-wsl.nix 86 + nixos-wsl.nixosModules.default 87 + ]; 36 88 }; 37 89 checks = forAllSystems (system: { 38 90 pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run { ··· 40 92 # If your hooks are intrusive, avoid running on each commit with a default_states like this: 41 93 # default_stages = ["manual" "push"]; 42 94 hooks = { 43 - nixpkgs-fmt.enable = true; 95 + nixfmt-rfc-style.enable = true; 44 96 nil.enable = true; 45 97 luacheck.enable = true; 46 98 }; ··· 49 101 devShells = forAllSystems (system: { 50 102 default = nixpkgs.legacyPackages.${system}.mkShell { 51 103 inherit (self.checks.${system}.pre-commit-check) shellHook; 52 - buildInputs = self.checks.${system}.pre-commit-check.enabledPackages; 104 + buildInputs = [ 105 + nixpkgs.legacyPackages.${system}.nixfmt-rfc-style 106 + ] ++ self.checks.${system}.pre-commit-check.enabledPackages; 53 107 }; 54 108 }); 109 + formatter = forAllSystems (system: inputs.nixpkgs.legacyPackages.${system}.nixfmt-rfc-style); 55 110 }; 56 111 }
+8 -4
gui.nix
··· 1 - { pkgs, ... }: 2 - let unstable = import <nixos-unstable> { }; 3 - in { 1 + { pkgs, unstable, ... }: 2 + { 4 3 # Enable the X11 windowing system. 5 4 services.xserver.enable = true; 6 5 ··· 66 65 # i3, for when I need XOrg 67 66 services.xserver.windowManager.i3 = { 68 67 enable = true; 69 - extraPackages = with pkgs; [ dmenu i3status i3lock i3blocks ]; 68 + extraPackages = with pkgs; [ 69 + dmenu 70 + i3status 71 + i3lock 72 + i3blocks 73 + ]; 70 74 }; 71 75 72 76 xdg.portal = {
+11 -6
home.nix
··· 1 - { pkgs, ... }: 2 - let 3 - unstable = import <nixos-unstable> { }; 4 - in 1 + { pkgs, unstable, ... }: 5 2 { 6 3 home.packages = with pkgs; [ 7 4 # main tool ··· 101 98 ]; 102 99 103 100 nix = { 104 - settings.experimental-features = [ "nix-command" "flakes" ]; 101 + settings.experimental-features = [ 102 + "nix-command" 103 + "flakes" 104 + ]; 105 105 }; 106 106 107 107 programs.fish = { ··· 114 114 defaultEditor = true; 115 115 withNodeJs = true; 116 116 withPython3 = true; 117 - extraPackages = with pkgs; [ unstable.fzf unstable.ripgrep luarocks unstable.tree-sitter ]; 117 + extraPackages = with pkgs; [ 118 + unstable.fzf 119 + unstable.ripgrep 120 + luarocks 121 + unstable.tree-sitter 122 + ]; 118 123 }; 119 124 programs.helix.enable = true; 120 125 programs.jujutsu = {
+22
host-specific/touma-wsl.nix
··· 1 + # Edit this configuration file to define what should be installed on 2 + # your system. Help is available in the configuration.nix(5) man page, on 3 + # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). 4 + 5 + # NixOS-WSL specific options are documented on the NixOS-WSL repository: 6 + # https://github.com/nix-community/NixOS-WSL 7 + 8 + { ... }: 9 + { 10 + imports = [ 11 + # WSL has no hardware configuration 12 + ../networking.nix 13 + ../users.nix 14 + ../packages.nix 15 + ../services.nix 16 + ]; 17 + wsl = { 18 + enable = true; 19 + defaultUser = "noah"; 20 + wslConf.network.hostname = "touma-wsl-nixos"; 21 + }; 22 + }
+2 -6
networking.nix
··· 1 - { ... }: { 2 - #networking.hostName = "touma-wsl-nixos"; 3 - 4 - #systemd.network.enable = true; 5 - #networking.useNetworkd = true; 6 - #services.resolved.enable = false; 1 + { ... }: 2 + { 7 3 8 4 services.avahi = { 9 5 enable = true;
+17 -23
users.nix
··· 1 1 { pkgs, lib, ... }: 2 2 let 3 - home-manager = builtins.fetchTarball 4 - "https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz"; 3 + home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz"; 5 4 in 6 5 { 7 - 8 - imports = [ 9 - # Import home-manager first, it's required for other modules 10 - (import "${home-manager}/nixos") 11 - ]; 12 6 13 7 # Declarative only optoins. 14 8 # I don't want to allow ad-hoc modifying users on the system. ··· 19 13 users.users.noah = { 20 14 isNormalUser = true; 21 15 shell = pkgs.fish; 22 - extraGroups = [ "wheel" "video" "nas" ]; # Enable ‘sudo’ for the user. 16 + extraGroups = [ 17 + "wheel" 18 + "video" 19 + "nas" 20 + ]; # Enable ‘sudo’ for the user. 23 21 hashedPasswordFile = "/etc/nixos/noah-password"; 24 - openssh.authorizedKeys.keys = 25 - lib.strings.splitString "\n" (builtins.readFile (builtins.fetchurl { 26 - url = "https://meta.sr.ht/~chiefnoah.keys"; 27 - name = "chiefnoah.keys"; 28 - # Update this with: 29 - # `curl https://meta.sr.ht/~chiefnoah.keys | sha256sum` 30 - sha256 = "b07f29019f0fcf2d7e217637fce6c7f9476468cc47cb8eaf36a0cd646aa4a8a7"; 31 - })); 22 + openssh.authorizedKeys.keys = lib.strings.splitString "\n" ( 23 + builtins.readFile ( 24 + builtins.fetchurl { 25 + url = "https://meta.sr.ht/~chiefnoah.keys"; 26 + name = "chiefnoah.keys"; 27 + # Update this with: 28 + # `curl https://meta.sr.ht/~chiefnoah.keys | sha256sum` 29 + sha256 = "b07f29019f0fcf2d7e217637fce6c7f9476468cc47cb8eaf36a0cd646aa4a8a7"; 30 + } 31 + ) 32 + ); 32 33 }; 33 34 users.groups.nas.gid = 1001; 34 - # I manage my home with home-manager 35 - # Don't store packages in ~/.nix-profile, use /etc/profiles so we can build-vm 36 - home-manager.useUserPackages = true; 37 - # No more NIX_PATH, use system pkgs 38 - home-manager.useGlobalPkgs = true; 39 - 40 - home-manager.users.noah = import ./home.nix; 41 35 }