This repository has no description
0

Configure Feed

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

superconfig / flake.nix
15 kB 394 lines
1{ 2 description = "lassulus superconfig"; 3 4 inputs = { 5 # tracking nixos-unstable; if a bump lands an uncached firefox-devedition (beta channel 6 # isn't channel-gating on Hydra) it builds from source. Check first: s firefox-devedition-watch 7 # then pin a cached rev here if needed: github:nixos/nixpkgs/<rev> 8 nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 9 # nixpkgs.url = "github:lassulus/nixpkgs/nixos-unstable"; 10 # nixpkgs.url = "path:/home/lass/tmp/nixpkgs-disk-debug"; 11 # nixpkgs.url = "git+file:/home/lass/src/nixpkgs"; 12 # nixpkgs.url = "git+file:/Users/lassulus/src/nixpkgs"; 13 14 nix-index-database.url = "github:nix-community/nix-index-database"; 15 nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; 16 17 nixvim.url = "github:nix-community/nixvim"; 18 nixvim.inputs.nixpkgs.follows = "nixpkgs"; 19 20 clan-core.url = "git+https://git.clan.lol/clan/clan-core"; 21 # clan-core.url = "path:/Users/lassulus/src/clan/clan-core"; 22 # clan-core.url = "path:/home/lass/src/clan/clan-core"; 23 clan-core.inputs.nixpkgs.follows = "nixpkgs"; 24 clan-core.inputs.disko.follows = "disko"; 25 26 stockholm.url = "git+https://github.com/krebs/stockholm?submodules=1"; 27 # stockholm.url = "git+https://cgit.lassul.us/stockholm"; 28 # stockholm.url = "path:/home/lass/sync/stockholm"; 29 stockholm.inputs.nixpkgs.follows = "nixpkgs"; 30 stockholm.inputs.buildbot-nix.follows = ""; 31 32 # Host database + retiolum modules. barnacle (darwin) consumes these 33 # directly; the NixOS machines still get their host data through 34 # stockholm's older kartei pin. 35 kartei.url = "github:krebs/kartei"; 36 kartei.inputs.nixpkgs.follows = "nixpkgs"; 37 38 disko.url = "github:nix-community/disko"; 39 # disko.url = "path:/home/lass/src/disko/"; 40 disko.inputs.nixpkgs.follows = "nixpkgs"; 41 42 nixos-hardware.url = "github:nixos/nixos-hardware"; 43 44 nether.url = "github:krebs/nether"; 45 # nether.url = "git+file:/home/lass/src/nether"; 46 nether.inputs.nixpkgs.follows = "nixpkgs"; 47 nether.inputs.clan-core.follows = "clan-core"; 48 nether.inputs.data-mesher.follows = ""; 49 50 spora.url = "github:krebs/spora"; 51 # spora.url = "git+file:/home/lass/src/spora"; 52 spora.inputs.nixpkgs.follows = "nixpkgs"; 53 54 nix-darwin.url = "github:LnL7/nix-darwin"; 55 nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; 56 57 nix-rosetta-builder.url = "github:cpick/nix-rosetta-builder"; 58 nix-rosetta-builder.inputs.nixpkgs.follows = "nixpkgs"; 59 60 nixos-facter.url = "github:numtide/nixos-facter-modules"; 61 62 treefmt-nix.url = "github:numtide/treefmt-nix"; 63 treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; 64 65 le_menu.url = "github:lassulus/le_menu"; 66 # le_menu.url = "git+file:/home/lass/src/le_menu"; 67 le_menu.inputs.nixpkgs.follows = "nixpkgs"; 68 69 extra-container.url = "github:erikarvstedt/extra-container"; 70 extra-container.inputs.nixpkgs.follows = "nixpkgs"; 71 72 llm-agents.url = "github:numtide/llm-agents.nix"; 73 llm-agents.inputs.nixpkgs.follows = "nixpkgs"; 74 75 hermes-agent.url = "github:nousresearch/hermes-agent"; 76 hermes-agent.inputs.nixpkgs.follows = "nixpkgs"; 77 78 rogue-talk.url = "github:rogue-talk/rogue-talk"; 79 rogue-talk.inputs.nixpkgs.follows = "nixpkgs"; 80 81 wrappers.url = "github:lassulus/wrappers"; 82 # wrappers.url = "git+file:/home/lass/src/wrappers"; 83 wrappers.inputs.nixpkgs.follows = "nixpkgs"; 84 85 opencrow.url = "github:pinpox/opencrow"; 86 opencrow.inputs.nixpkgs.follows = "nixpkgs"; 87 88 nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver"; 89 nixos-mailserver.inputs.nixpkgs.follows = "nixpkgs"; 90 91 covibe.url = "github:lassulus/covibe"; 92 covibe.inputs.nixpkgs.follows = "nixpkgs"; 93 # One omp revision (and one build) for covibe's patched omp and llm.omp. 94 covibe.inputs.llm-agents.follows = "llm-agents"; 95 96 sigexec.url = "git+https://git.geninf.io/Lassulus/sigexec"; 97 sigexec.inputs.nixpkgs.follows = "nixpkgs"; 98 99 }; 100 101 outputs = 102 inputs@{ 103 self, 104 nixpkgs, 105 clan-core, 106 ... 107 }: 108 let 109 clan = clan-core.lib.clan { 110 self = self; 111 specialArgs.self = self; 112 modules = import ./clan_modules { inherit nixpkgs; }; 113 vars.settings.secretStore = "password-store"; 114 meta.domain = "s"; 115 inventory = { 116 meta.name = "superconfig"; 117 machines = { 118 ignavia.tags = [ 119 "laptop" 120 "focus" 121 ]; 122 mors.tags = [ 123 "laptop" 124 "focus" 125 ]; 126 aergia.tags = [ 127 "laptop" 128 "focus" 129 ]; 130 barnacle = { 131 machineClass = "darwin"; 132 tags = [ 133 "laptop" 134 "focus" 135 ]; 136 }; 137 icarus.tags = [ "laptop" ]; 138 neoprism.tags = [ "server" ]; 139 starkstrom = { 140 tags = [ "server" ]; 141 deploy.forwardAgent = true; 142 }; 143 }; 144 instances = { 145 tor = { 146 roles.server.tags.all = { }; 147 }; 148 retiolum = { 149 module.input = "self"; 150 roles.default.tags.nixos = { }; 151 }; 152 internet = { 153 roles.default.machines = { 154 neoprism.settings.host = "neoprism.lassul.us"; 155 neoprism.settings.port = 45621; 156 starkstrom.settings.host = "194.110.87.67"; 157 starkstrom.settings.port = 45621; 158 }; 159 }; 160 state-version = { 161 module.name = "importer"; 162 roles.default.tags.all = { }; 163 roles.default.settings.extraModules = [ 164 { 165 clan.core.state-version.enable = true; 166 } 167 ]; 168 }; 169 yggdrasil = { 170 roles.default.tags.nixos = { }; 171 }; 172 tor-yggdrasil = { 173 module.name = "tor"; 174 roles.client.tags.nixos = { }; 175 roles.server.tags.nixos = { }; 176 roles.server.settings = { 177 secretHostname = false; 178 portMapping = [ 179 { 180 # tcp 181 port = 6443; 182 target.port = 6443; 183 } 184 { 185 # tls 186 port = 6446; 187 target.port = 6443; 188 } 189 ]; 190 }; 191 }; 192 }; 193 }; 194 machines = 195 nixpkgs.lib.mapAttrs 196 (machineName: _: { 197 imports = [ 198 ./machines/${machineName}/physical.nix 199 ]; 200 }) 201 ( 202 nixpkgs.lib.filterAttrs ( 203 machineName: _: builtins.pathExists ./machines/${machineName}/physical.nix 204 ) (builtins.readDir ./machines) 205 ); 206 }; 207 in 208 clan-core.inputs.flake-parts.lib.mkFlake { inherit inputs; } { 209 systems = [ 210 "x86_64-linux" 211 "aarch64-linux" 212 "aarch64-darwin" 213 "x86_64-darwin" 214 ]; 215 imports = [ 216 ./formatter.nix 217 ./5pkgs/flake-module.nix 218 ./keys/flake-module.nix 219 ./retiolum/flake-module.nix 220 ./skills/flake-module.nix 221 ./games/flake-module.nix 222 223 ./wrapperModules/pi/flake-module.nix 224 ./wrapperModules/claude-code/flake-module.nix 225 ./wrapperModules/noctalia-shell/flake-module.nix 226 { 227 options.flake.wrapperModules = nixpkgs.lib.mkOption { 228 type = nixpkgs.lib.types.lazyAttrsOf nixpkgs.lib.types.raw; 229 default = { }; 230 }; 231 } 232 ] 233 ++ ( 234 # Auto-import all flake-module.nix files from tools subdirectories 235 let 236 toolDirs = builtins.attrNames ( 237 nixpkgs.lib.filterAttrs (_: type: type == "directory") (builtins.readDir ./tools) 238 ); 239 in 240 map (dir: ./tools + "/${dir}/flake-module.nix") toolDirs 241 ); 242 flake.nixosConfigurations = clan.config.nixosConfigurations; 243 flake.clanInternals = clan.config.clanInternals; 244 flake.darwinConfigurations = clan.config.darwinConfigurations; 245 flake.clan = clan.config; 246 247 # Container configurations for use with extra-container 248 # Auto-discovers machines with container.nix 249 flake.containerConfigurations = 250 nixpkgs.lib.mapAttrs 251 (machineName: _: import ./machines/${machineName}/container.nix { inherit self; }) 252 ( 253 nixpkgs.lib.filterAttrs ( 254 machineName: _: builtins.pathExists ./machines/${machineName}/container.nix 255 ) (builtins.readDir ./machines) 256 ); 257 258 perSystem = 259 { 260 lib, 261 pkgs, 262 system, 263 ... 264 }: 265 { 266 packages = { 267 default = inputs.le_menu.lib.buildMenu { 268 inherit pkgs; 269 menuConfig = { 270 vim.run = "nix run ${self}#nvim"; 271 shell.run = "nix run ${self}#shell"; 272 machines.submenu = lib.mapAttrs (name: _machine: { 273 submenu.ssh.submenu = { 274 retiolum.run = "ssh -t ${name}.r"; 275 spora.run = "ssh ${name}.s"; 276 nether.run = "ssh ${name}.n"; 277 tor.run = "torify ssh $(pass show machines/${name}/tor-hostname)"; 278 }; 279 }) self.nixosConfigurations; 280 debug.run = "env"; 281 }; 282 }; 283 clan-cli = clan-core.packages.${system}.clan-cli; 284 } 285 // lib.mapAttrs' ( 286 name: containerConfig: 287 lib.nameValuePair "container-${name}" ( 288 inputs.extra-container.lib.buildContainers { 289 inherit system; 290 nixpkgs = inputs.nixpkgs; 291 config = { 292 # Workaround: extra-container's minimal module set doesn't 293 # include nixos-init.nix, but systemd.nix now references 294 # config.system.nixos-init.package for env-generator. 295 # Provide a dummy option until extra-container is updated. 296 297 imports = [ 298 ( 299 { pkgs, lib, ... }: 300 { 301 options.system.nixos-init.package = lib.mkPackageOption pkgs "nixos-init" { }; 302 options.time.timeZone = lib.mkOption { 303 type = lib.types.nullOr lib.types.str; 304 default = null; 305 description = "Dummy option for extra-container compatibility"; 306 }; 307 options.services.openssh = { 308 enable = lib.mkOption { 309 type = lib.types.bool; 310 default = false; 311 description = "Dummy option for extra-container compatibility"; 312 }; 313 package = lib.mkPackageOption pkgs "openssh" { }; 314 }; 315 # systemd.nix sets environment.variables.SYSTEMD_XKB_DIRECTORY, 316 # but the minimal module set omits config/system-environment.nix 317 # which declares the option. 318 options.environment.variables = lib.mkOption { 319 type = lib.types.attrsOf lib.types.anything; 320 default = { }; 321 description = "Dummy option for extra-container compatibility"; 322 }; 323 # systemd.nix reads config.i18n.imperativeLocale, but the 324 # minimal module set omits config/i18n.nix which declares it. 325 options.i18n.imperativeLocale = lib.mkOption { 326 type = lib.types.bool; 327 default = true; 328 description = "Dummy option for extra-container compatibility"; 329 }; 330 # nixos-containers.nix reads config.nix.enable and 331 # config.nix.daemon.enable for the /nix/var/nix bind 332 # mounts, but the minimal module set omits 333 # config/nix.nix which declares them. 334 options.nix = { 335 enable = lib.mkOption { 336 type = lib.types.bool; 337 default = true; 338 description = "Dummy option for extra-container compatibility"; 339 }; 340 daemon.enable = lib.mkOption { 341 type = lib.types.bool; 342 default = true; 343 description = "Dummy option for extra-container compatibility"; 344 }; 345 }; 346 } 347 ) 348 ]; 349 containers.${name} = containerConfig; 350 }; 351 } 352 ) 353 ) self.containerConfigurations; 354 devShells.default = pkgs.mkShell { 355 packages = [ 356 self.packages.${pkgs.system}.pass 357 (self.legacyPackages.${system}.bin_shim { 358 name = "clan"; 359 pkg_name = "clan-cli"; 360 }) 361 ]; 362 }; 363 legacyPackages.llm = inputs.llm-agents.packages.${system}; 364 checks = 365 let 366 # Check NixOS configurations can be evaluated (without building) 367 nixosChecks = lib.mapAttrs' ( 368 name: config: 369 lib.nameValuePair "nixos-${name}" ( 370 pkgs.runCommand "eval-${name}" { } '' 371 # Force evaluation of the toplevel path without building 372 echo "Evaluating ${name}: ${builtins.unsafeDiscardStringContext config.config.system.build.toplevel.drvPath}" 373 touch $out 374 '' 375 ) 376 ) (lib.filterAttrs (_: config: config.pkgs.system == system) self.nixosConfigurations); 377 378 # Check Darwin configurations can be evaluated (without building) 379 darwinChecks = lib.mapAttrs' ( 380 name: config: 381 lib.nameValuePair "darwin-${name}" ( 382 pkgs.runCommand "eval-darwin-${name}" { } '' 383 # Force evaluation of the system path without building 384 echo "Evaluating ${name}: ${builtins.unsafeDiscardStringContext config.system.drvPath}" 385 touch $out 386 '' 387 ) 388 ) (lib.filterAttrs (_: config: config.pkgs.system == system) self.darwinConfigurations); 389 in 390 nixosChecks // darwinChecks; 391 }; 392 flake.lib = import ./lib { inherit (nixpkgs) lib; }; 393 }; 394}