This repository has no description
0

Configure Feed

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

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