This repository has no description
0

Configure Feed

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

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