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.

at master 283 lines 8.8 kB view raw
1{ 2 description = "Home Manager configuration for noah"; 3 4 inputs = { 5 # Specify the source of Home Manager and Nixpkgs. 6 nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; 7 nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; 8 nixos-wsl = { 9 url = "github:nix-community/NixOS-WSL/main"; 10 inputs.nixpkgs.follows = "nixpkgs"; 11 }; 12 determinite = { 13 url = "https://flakehub.com/f/DeterminateSystems/determinate/3"; 14 inputs.nixpkgs.follows = "nixpkgs"; 15 }; 16 home-manager = { 17 url = "github:nix-community/home-manager/release-25.11"; 18 inputs.nixpkgs.follows = "nixpkgs"; 19 }; 20 pre-commit-hooks = { 21 url = "github:cachix/git-hooks.nix"; 22 inputs.nixpkgs.follows = "nixpkgs"; 23 }; 24 agenix = { 25 url = "github:ryantm/agenix"; 26 inputs.nixpkgs.follows = "nixpkgs"; 27 }; 28 tangled = { 29 url = "git+https://tangled.org/@tangled.org/core?ref=refs/tags/v1.13.0-alpha"; 30 inputs.nixpkgs.follows = "nixpkgs"; 31 }; 32 tranquil-pds = { 33 url = "git+https://tangled.org/tranquil.farm/tranquil-pds"; 34 inputs.nixpkgs.follows = "nixpkgs"; 35 }; 36 claude-code = { 37 url = "github:sadjow/claude-code-nix"; 38 inputs.nixpkgs.follows = "nixpkgs"; 39 }; 40 valheim-server = { 41 url = "github:chiefnoah/valheim-server-flake"; 42 inputs.nixpkgs.follows = "nixpkgs"; 43 }; 44 nixpkgs-search = { 45 url = "git+https://git.sr.ht/~chiefnoah/nixpkgs-search"; 46 inputs.nixpkgs.follows = "nixpkgs"; 47 }; 48 }; 49 50 outputs = 51 { 52 self, 53 nixpkgs, 54 nixpkgs-unstable, 55 nixos-wsl, 56 determinite, 57 home-manager, 58 pre-commit-hooks, 59 agenix, 60 tangled, 61 tranquil-pds, 62 claude-code, 63 valheim-server, 64 nixpkgs-search, 65 ... 66 }@inputs: 67 let 68 supportedSystems = [ 69 "x86_64-linux" 70 "aarch64-linux" 71 "x86_64-darwin" 72 "aarch64-darwin" 73 ]; 74 forAllSystems = nixpkgs.lib.genAttrs supportedSystems; 75 basicSystem = 76 { 77 system ? "x86_64-linux", 78 modules ? [ ], 79 useUnstable ? false, 80 extraGroups ? [ ], 81 overlays ? [ ], 82 enableNFTables ? true, 83 }: 84 let 85 unstable = import nixpkgs-unstable { 86 inherit system; 87 overlays = overlays ++ [ 88 # Use the neovim overlay for all hosts 89 (import ./overlays/neovim.nix) 90 (import ./overlays/codex.nix) 91 ]; 92 config.allowUnfree = true; 93 }; 94 in 95 inputs.nixpkgs.lib.nixosSystem { 96 inherit system; 97 specialArgs = { 98 inherit inputs extraGroups enableNFTables; 99 } 100 // nixpkgs.lib.optionalAttrs useUnstable { 101 inherit unstable; 102 }; 103 modules = [ 104 determinite.nixosModules.default 105 ./common.nix 106 ./users.nix 107 ./services.nix 108 agenix.nixosModules.default 109 home-manager.nixosModules.home-manager 110 { 111 home-manager.useGlobalPkgs = true; 112 home-manager.useUserPackages = true; 113 home-manager.users.noah = ./default-home.nix; 114 home-manager.extraSpecialArgs = { 115 inherit inputs; 116 } 117 // nixpkgs.lib.optionalAttrs useUnstable { 118 inherit unstable; 119 }; 120 } 121 ] 122 ++ modules; 123 }; 124 in 125 { 126 # incomplete 127 nixosConfigurations.odin = basicSystem { 128 extraGroups = [ 129 "libvirtd" 130 "qemu-libvirtd" 131 "docker" 132 ]; 133 useUnstable = true; 134 modules = [ 135 ./host-specific/odin/configuration.nix 136 valheim-server.nixosModules.default 137 ]; 138 }; 139 nixosConfigurations.shizuri = basicSystem { 140 useUnstable = true; 141 modules = [ 142 ./host-specific/shizuri/configuration.nix 143 ]; 144 overlays = [ 145 (final: prev: { 146 lmstudio = final.pkgs.callPackage ./overlays/lmstudio.nix { }; 147 }) 148 ]; 149 }; 150 nixosConfigurations.misaki = basicSystem { 151 useUnstable = true; 152 extraGroups = [ 153 "render" 154 "nats" 155 "litterbox" 156 "httpd" 157 ]; 158 modules = [ 159 ./host-specific/misaki/configuration.nix 160 ]; 161 overlays = [ 162 (final: prev: { 163 # Override the version of Plex installed to be the latest 164 plexRaw = prev.plexRaw.overrideAttrs rec { 165 version = "1.43.1.10611-1e34174b1"; 166 src = final.fetchurl { 167 url = "https://downloads.plex.tv/plex-media-server-new/${version}/debian/plexmediaserver_${version}_amd64.deb"; 168 sha256 = "pr1+VSObX0sBl/AddeG/+2dIbNdc+EtnvCzy4nTXVn8="; 169 }; 170 }; 171 ## Override the json object that contains verions and hashes for Immich 172 #immich = prev.immich.override { sourcesJSON = ./overrides/immich-sources.json; }; 173 ## Fix errors wit numpy version failing to resolve in the immich ML package 174 #immich-machine-learning = prev.immich-machine-learning.overrideAttrs 175 # (finalAttrs: prevAttrs: { 176 # pythonRelaxDeps = prevAttrs.pythonRelaxDeps ++ [ "numpy" ]; 177 # }); 178 }) 179 ]; 180 }; 181 nixosConfigurations.touma-wsl = basicSystem { 182 useUnstable = true; 183 modules = [ 184 ./host-specific/touma-wsl.nix 185 nixos-wsl.nixosModules.default 186 ]; 187 enableNFTables = false; 188 }; 189 nixosConfigurations.edge = basicSystem { 190 useUnstable = true; 191 modules = [ 192 ./host-specific/edge/configuration.nix 193 ]; 194 }; 195 homeConfigurations."noah-aleister" = home-manager.lib.homeManagerConfiguration { 196 pkgs = import nixpkgs { 197 system = "aarch64-darwin"; 198 config.allowUnfree = true; 199 overlays = [ 200 (final: prev: { 201 claude-code = claude-code.packages.aarch64-darwin.claude-code; 202 }) 203 ]; 204 }; 205 # Specify your home configuration modules here, for example, 206 # the path to your home.nix. 207 modules = [ 208 ./host-specific/aleister-noah.nix 209 ./overlays/inetutils.nix 210 agenix.homeManagerModules.default 211 ]; 212 213 # Optionally use extraSpecialArgs 214 # to pass through arguments to home.nix 215 extraSpecialArgs = { 216 unstable = import nixpkgs-unstable { 217 system = "aarch64-darwin"; 218 config.allowUnfree = true; 219 overlays = [ 220 (import ./overlays/neovim.nix) 221 (import ./overlays/codex.nix) 222 ]; 223 }; 224 }; 225 }; 226 homeConfigurations."noah" = 227 let 228 system = "x86_64-linux"; 229 pkgs = import nixpkgs { 230 inherit system; 231 config.allowUnfree = true; 232 }; 233 unstable = import nixpkgs-unstable { 234 inherit system; 235 config.allowUnfree = true; 236 overlays = [ 237 (import ./overlays/neovim.nix) 238 (import ./overlays/codex.nix) 239 ]; 240 }; 241 in 242 home-manager.lib.homeManagerConfiguration { 243 inherit pkgs; 244 # Specify your home configuration modules here, for example, 245 # the path to your home.nix. 246 modules = [ 247 ./default-home.nix 248 { 249 nix.package = pkgs.nix; 250 } 251 ]; 252 # Optionally use extraSpecialArgs 253 # to pass through arguments to home.nix 254 extraSpecialArgs = { 255 inherit unstable; 256 inputs = inputs; 257 }; 258 }; 259 checks = forAllSystems (system: { 260 pre-commit-check = pre-commit-hooks.lib.${system}.run { 261 src = ./.; 262 # If your hooks are intrusive, avoid running on each commit with a default_states like this: 263 # default_stages = ["manual" "push"]; 264 hooks = { 265 nixfmt-rfc-style.enable = true; 266 nil.enable = true; 267 luacheck.enable = true; 268 }; 269 }; 270 }); 271 devShells = forAllSystems (system: { 272 default = nixpkgs.legacyPackages.${system}.mkShell { 273 inherit (self.checks.${system}.pre-commit-check) shellHook; 274 buildInputs = [ 275 nixpkgs.legacyPackages.${system}.nixfmt-rfc-style 276 nixpkgs-unstable.legacyPackages.${system}.lua-language-server 277 ] 278 ++ self.checks.${system}.pre-commit-check.enabledPackages; 279 }; 280 }); 281 formatter = forAllSystems (system: inputs.nixpkgs.legacyPackages.${system}.nixfmt-rfc-style); 282 }; 283}