Configuration for my NixOS based systems and Home Manager
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

WIP: convert to using flake

+153 -81
+6 -5
configuration.nix odin.nix
··· 2 2 ## your system. Help is available in the configuration.nix(5) man page, on 3 3 # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). 4 4 5 - { ... }: 6 - let 7 - agenix = builtins.fetchTarball "https://github.com/ryantm/agenix/archive/main.tar.gz"; 8 - in 5 + { pkgs, config, nixpkgs-unstable, unstable, ... }: 9 6 { 10 7 imports = 11 8 [ ··· 14 11 ./boot.nix 15 12 ./networking.nix 16 13 ./gui.nix 17 - (import "${agenix}/modules/age.nix") 18 14 ./users.nix 19 15 ./packages.nix 20 16 ./services.nix 21 17 ]; 18 + _module.args.unstable = import nixpkgs-unstable { 19 + inherit (pkgs.stdenv.hostPlatform) system; 20 + inherit (config.nixpkgs) config; 21 + }; 22 22 23 + nixpkgs.config.allowUnfree = true; 23 24 # Set your time zone. 24 25 time.timeZone = "America/Chicago"; 25 26
+121 -25
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": 1754433428, 12 + "narHash": "sha256-NA/FT2hVhKDftbHSwVnoRTFhes62+7dxZbxj5Gxvghs=", 13 + "owner": "ryantm", 14 + "repo": "agenix", 15 + "rev": "9edb1787864c4f59ae5074ad498b6272b3ec308d", 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 + }, 3 46 "flake-compat": { 4 47 "flake": false, 5 48 "locked": { 6 - "lastModified": 1696426674, 7 - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", 49 + "lastModified": 1747046372, 50 + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", 8 51 "owner": "edolstra", 9 52 "repo": "flake-compat", 10 - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", 53 + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", 11 54 "type": "github" 12 55 }, 13 56 "original": { ··· 40 83 "home-manager": { 41 84 "inputs": { 42 85 "nixpkgs": [ 86 + "agenix", 43 87 "nixpkgs" 44 88 ] 45 89 }, 46 90 "locked": { 47 - "lastModified": 1744743431, 48 - "narHash": "sha256-iyn/WBYDc7OtjSawbegINDe/gIkok888kQxk3aVnkgg=", 91 + "lastModified": 1745494811, 92 + "narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=", 49 93 "owner": "nix-community", 50 94 "repo": "home-manager", 51 - "rev": "c61bfe3ae692f42ce688b5865fac9e0de58e1387", 95 + "rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be", 52 96 "type": "github" 53 97 }, 54 98 "original": { 55 99 "owner": "nix-community", 56 - "ref": "release-24.11", 100 + "repo": "home-manager", 101 + "type": "github" 102 + } 103 + }, 104 + "home-manager_2": { 105 + "inputs": { 106 + "nixpkgs": [ 107 + "nixpkgs" 108 + ] 109 + }, 110 + "locked": { 111 + "lastModified": 1753592768, 112 + "narHash": "sha256-oV695RvbAE4+R9pcsT9shmp6zE/+IZe6evHWX63f2Qg=", 113 + "owner": "nix-community", 114 + "repo": "home-manager", 115 + "rev": "fc3add429f21450359369af74c2375cb34a2d204", 116 + "type": "github" 117 + }, 118 + "original": { 119 + "owner": "nix-community", 120 + "ref": "release-25.05", 57 121 "repo": "home-manager", 58 122 "type": "github" 59 123 } 60 124 }, 61 125 "nixpkgs": { 62 126 "locked": { 63 - "lastModified": 1744440957, 64 - "narHash": "sha256-FHlSkNqFmPxPJvy+6fNLaNeWnF1lZSgqVCl/eWaJRc4=", 65 - "owner": "nixos", 127 + "lastModified": 1754028485, 128 + "narHash": "sha256-IiiXB3BDTi6UqzAZcf2S797hWEPCRZOwyNThJIYhUfk=", 129 + "owner": "NixOS", 66 130 "repo": "nixpkgs", 67 - "rev": "26d499fc9f1d567283d5d56fcf367edd815dba1d", 131 + "rev": "59e69648d345d6e8fef86158c555730fa12af9de", 68 132 "type": "github" 69 133 }, 70 134 "original": { 71 - "owner": "nixos", 72 - "ref": "nixos-24.11", 135 + "owner": "NixOS", 136 + "ref": "nixos-25.05", 73 137 "repo": "nixpkgs", 74 138 "type": "github" 75 139 } 76 140 }, 77 141 "nixpkgs-unstable": { 78 142 "locked": { 79 - "lastModified": 1744463964, 80 - "narHash": "sha256-LWqduOgLHCFxiTNYi3Uj5Lgz0SR+Xhw3kr/3Xd0GPTM=", 143 + "lastModified": 1755186698, 144 + "narHash": "sha256-wNO3+Ks2jZJ4nTHMuks+cxAiVBGNuEBXsT29Bz6HASo=", 81 145 "owner": "nixos", 82 146 "repo": "nixpkgs", 83 - "rev": "2631b0b7abcea6e640ce31cd78ea58910d31e650", 147 + "rev": "fbcf476f790d8a217c3eab4e12033dc4a0f6d23c", 84 148 "type": "github" 85 149 }, 86 150 "original": { ··· 92 156 }, 93 157 "nixpkgs_2": { 94 158 "locked": { 95 - "lastModified": 1730768919, 96 - "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", 159 + "lastModified": 1755274400, 160 + "narHash": "sha256-rTInmnp/xYrfcMZyFMH3kc8oko5zYfxsowaLv1LVobY=", 161 + "owner": "nixos", 162 + "repo": "nixpkgs", 163 + "rev": "ad7196ae55c295f53a7d1ec39e4a06d922f3b899", 164 + "type": "github" 165 + }, 166 + "original": { 167 + "owner": "nixos", 168 + "ref": "nixos-25.05", 169 + "repo": "nixpkgs", 170 + "type": "github" 171 + } 172 + }, 173 + "nixpkgs_3": { 174 + "locked": { 175 + "lastModified": 1754340878, 176 + "narHash": "sha256-lgmUyVQL9tSnvvIvBp7x1euhkkCho7n3TMzgjdvgPoU=", 97 177 "owner": "NixOS", 98 178 "repo": "nixpkgs", 99 - "rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc", 179 + "rev": "cab778239e705082fe97bb4990e0d24c50924c04", 100 180 "type": "github" 101 181 }, 102 182 "original": { ··· 110 190 "inputs": { 111 191 "flake-compat": "flake-compat", 112 192 "gitignore": "gitignore", 113 - "nixpkgs": "nixpkgs_2" 193 + "nixpkgs": "nixpkgs_3" 114 194 }, 115 195 "locked": { 116 - "lastModified": 1742649964, 117 - "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=", 196 + "lastModified": 1755446520, 197 + "narHash": "sha256-I0Ok1OGDwc1jPd8cs2VvAYZsHriUVFGIUqW+7uSsOUM=", 118 198 "owner": "cachix", 119 199 "repo": "git-hooks.nix", 120 - "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82", 200 + "rev": "4b04db83821b819bbbe32ed0a025b31e7971f22e", 121 201 "type": "github" 122 202 }, 123 203 "original": { ··· 128 208 }, 129 209 "root": { 130 210 "inputs": { 131 - "home-manager": "home-manager", 132 - "nixpkgs": "nixpkgs", 211 + "agenix": "agenix", 212 + "home-manager": "home-manager_2", 213 + "nixpkgs": "nixpkgs_2", 133 214 "nixpkgs-unstable": "nixpkgs-unstable", 134 215 "pre-commit-hooks": "pre-commit-hooks" 216 + } 217 + }, 218 + "systems": { 219 + "locked": { 220 + "lastModified": 1681028828, 221 + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 222 + "owner": "nix-systems", 223 + "repo": "default", 224 + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 225 + "type": "github" 226 + }, 227 + "original": { 228 + "owner": "nix-systems", 229 + "repo": "default", 230 + "type": "github" 135 231 } 136 232 } 137 233 },
+24 -19
flake.nix
··· 1 1 { 2 - description = "Home Manager configuration of noah"; 2 + description = "NixOS Configuration module"; 3 3 4 4 inputs = { 5 5 # Specify the source of Home Manager and Nixpkgs. 6 - nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; 6 + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; 7 7 nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; 8 8 home-manager = { 9 - url = "github:nix-community/home-manager/release-24.11"; 9 + url = "github:nix-community/home-manager/release-25.05"; 10 10 inputs.nixpkgs.follows = "nixpkgs"; 11 11 }; 12 12 pre-commit-hooks.url = "github:cachix/git-hooks.nix"; 13 + agenix.url = "github:ryantm/agenix"; 13 14 }; 14 15 15 16 outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, pre-commit-hooks, ... }@inputs: 16 17 let 17 - system = "aarch64-darwin"; 18 - pkgs = nixpkgs.legacyPackages.${system}; 19 - unstable-pkgs = nixpkgs-unstable.legacyPackages.${system}; 20 18 supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; 21 19 forAllSystems = nixpkgs.lib.genAttrs supportedSystems; 22 20 in 23 21 { 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 - }; 36 - }; 37 22 checks = forAllSystems (system: { 38 23 pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run { 39 24 src = ./.; ··· 52 37 buildInputs = self.checks.${system}.pre-commit-check.enabledPackages; 53 38 }; 54 39 }); 40 + nixosConfigurations = { 41 + odin = nixpkgs.lib.nixosSystem { 42 + system = "x86_64-linux"; 43 + specialArgs = { inherit inputs; }; 44 + modules = [ 45 + ./odin.nix 46 + home-manager.nixosModules.home-manager 47 + { 48 + # I manage my home with home-manager 49 + # Don't store packages in ~/.nix-profile, use /etc/profiles so we can build-vm 50 + home-manager.useUserPackages = true; 51 + # No more NIX_PATH, use system pkgs 52 + home-manager.useGlobalPkgs = true; 53 + 54 + home-manager.users.noah = import ./home.nix; 55 + home-manager.extraSpecialArgs = inputs; 56 + } 57 + ]; 58 + }; 59 + }; 55 60 }; 56 61 }
-3
gui.nix
··· 1 1 { pkgs, ... }: 2 - let 3 - unstable = import <nixos-unstable> { }; 4 - in 5 2 { 6 3 # Enable the X11 windowing system. 7 4 services.xserver = {
+1 -13
noah-home.nix home.nix
··· 1 - { pkgs, lib, ... }: 2 - let 3 - unstable = import <nixos-unstable> { 4 - config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ 5 - "jetbrains-toolbox" 6 - "jetbrains.rust-rover" 7 - "rust-rover" 8 - "discord" 9 - "google-chrome" 10 - "slack" 11 - ]; 12 - }; 13 - in 1 + { pkgs, unstable, ... }: 14 2 { 15 3 home.sessionVariables = { 16 4 NIXOS_OZONE_WL = "1";
+1 -16
users.nix
··· 1 1 { pkgs, lib, ... }: 2 - let 3 - home-manager = builtins.fetchTarball 4 - "https://github.com/nix-community/home-manager/archive/release-25.05.tar.gz"; 5 - in 6 2 { 7 3 8 - imports = [ 9 - # Import home-manager first, it's required for other modules 10 - (import "${home-manager}/nixos") 11 - ]; 4 + imports = [ ]; 12 5 13 6 # Declarative only optoins. 14 7 # I don't want to allow ad-hoc modifying users on the system. ··· 33 26 }; 34 27 35 28 users.groups.nas.gid = 1001; 36 - 37 - # I manage my home with home-manager 38 - # Don't store packages in ~/.nix-profile, use /etc/profiles so we can build-vm 39 - home-manager.useUserPackages = true; 40 - # No more NIX_PATH, use system pkgs 41 - home-manager.useGlobalPkgs = true; 42 - 43 - home-manager.users.noah = import ./noah-home.nix; 44 29 }