This repository has no description
0

Configure Feed

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

superconfig / flake.nix
10 kB 288 lines
1{ 2 description = "lassulus superconfig"; 3 4 inputs = { 5 nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 6 # nixpkgs.url = "github:lassulus/nixpkgs/nixos-unstable"; 7 # nixpkgs.url = "path:/home/lass/tmp/nixpkgs-disk-debug"; 8 # nixpkgs.url = "git+file:/home/lass/src/nixpkgs"; 9 # nixpkgs.url = "git+file:/Users/lassulus/src/nixpkgs"; 10 11 nix-index-database.url = "github:nix-community/nix-index-database"; 12 nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; 13 14 nixvim.url = "github:nix-community/nixvim"; 15 nixvim.inputs.nixpkgs.follows = "nixpkgs"; 16 17 clan-core.url = "git+https://git.clan.lol/clan/clan-core"; 18 # clan-core.url = "path:/Users/lassulus/src/clan/clan-core"; 19 # clan-core.url = "path:/home/lass/src/clan/clan-core"; 20 clan-core.inputs.nixpkgs.follows = "nixpkgs"; 21 clan-core.inputs.disko.follows = "disko"; 22 23 stockholm.url = "git+https://github.com/krebs/stockholm?submodules=1"; 24 # stockholm.url = "git+https://cgit.lassul.us/stockholm"; 25 # stockholm.url = "path:/home/lass/sync/stockholm"; 26 stockholm.inputs.nixpkgs.follows = "nixpkgs"; 27 stockholm.inputs.buildbot-nix.follows = ""; 28 29 disko.url = "github:nix-community/disko"; 30 # disko.url = "path:/home/lass/src/disko/"; 31 disko.inputs.nixpkgs.follows = "nixpkgs"; 32 33 nixos-hardware.url = "github:nixos/nixos-hardware"; 34 35 nether.url = "github:krebs/nether"; 36 # nether.url = "git+file:/home/lass/src/nether"; 37 nether.inputs.nixpkgs.follows = "nixpkgs"; 38 nether.inputs.clan-core.follows = "clan-core"; 39 nether.inputs.data-mesher.follows = ""; 40 41 spora.url = "github:krebs/spora"; 42 # spora.url = "git+file:/home/lass/src/spora"; 43 spora.inputs.nixpkgs.follows = "nixpkgs"; 44 45 nix-darwin.url = "github:LnL7/nix-darwin"; 46 nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; 47 48 nix-rosetta-builder.url = "github:cpick/nix-rosetta-builder"; 49 nix-rosetta-builder.inputs.nixpkgs.follows = "nixpkgs"; 50 51 nixos-facter.url = "github:numtide/nixos-facter-modules"; 52 53 treefmt-nix.url = "github:numtide/treefmt-nix"; 54 treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; 55 56 le_menu.url = "github:lassulus/le_menu"; 57 # le_menu.url = "git+file:/home/lass/src/le_menu"; 58 le_menu.inputs.nixpkgs.follows = "nixpkgs"; 59 60 extra-container.url = "github:erikarvstedt/extra-container"; 61 extra-container.inputs.nixpkgs.follows = "nixpkgs"; 62 63 llm-agents.url = "github:numtide/llm-agents.nix"; 64 llm-agents.inputs.nixpkgs.follows = "nixpkgs"; 65 66 rogue-talk.url = "github:rogue-talk/rogue-talk"; 67 rogue-talk.inputs.nixpkgs.follows = "nixpkgs"; 68 }; 69 70 outputs = 71 inputs@{ 72 self, 73 nixpkgs, 74 clan-core, 75 ... 76 }: 77 let 78 clan = clan-core.lib.clan { 79 self = self; 80 specialArgs.self = self; 81 modules = import ./clan_modules { inherit nixpkgs; }; 82 vars.settings.secretStore = "password-store"; 83 meta.domain = "s"; 84 inventory = { 85 meta.name = "superconfig"; 86 machines = { 87 ignavia.tags = [ 88 "laptop" 89 "focus" 90 ]; 91 mors.tags = [ 92 "laptop" 93 "focus" 94 ]; 95 aergia.tags = [ 96 "laptop" 97 "focus" 98 ]; 99 barnacle = { 100 machineClass = "darwin"; 101 tags = [ 102 "laptop" 103 "focus" 104 ]; 105 }; 106 icarus.tags = [ "laptop" ]; 107 prism.tags = [ "server" ]; 108 neoprism.tags = [ "server" ]; 109 }; 110 instances = { 111 tor = { 112 roles.server.tags.all = { }; 113 }; 114 internet = { 115 roles.default.machines = { 116 prism.settings.host = "prism.lassul.us"; 117 prism.settings.port = 45621; 118 neoprism.settings.host = "neoprism.lassul.us"; 119 neoprism.settings.port = 45621; 120 }; 121 }; 122 state-version = { 123 module.name = "importer"; 124 roles.default.tags.all = { }; 125 roles.default.settings.extraModules = [ 126 { 127 clan.core.state-version.enable = true; 128 } 129 ]; 130 }; 131 yggdrasil = { 132 roles.default.tags.nixos = { }; 133 }; 134 tor-yggdrasil = { 135 module.name = "tor"; 136 roles.client.tags.all = { }; 137 roles.server.tags.all = { }; 138 roles.server.settings = { 139 secretHostname = false; 140 portMapping = [ 141 { 142 # tcp 143 port = 6443; 144 target.port = 6443; 145 } 146 { 147 # tls 148 port = 6446; 149 target.port = 6443; 150 } 151 ]; 152 }; 153 }; 154 }; 155 }; 156 machines = 157 nixpkgs.lib.mapAttrs 158 (machineName: _: { 159 imports = [ 160 ./machines/${machineName}/physical.nix 161 ]; 162 }) 163 ( 164 nixpkgs.lib.filterAttrs ( 165 machineName: _: builtins.pathExists ./machines/${machineName}/physical.nix 166 ) (builtins.readDir ./machines) 167 ); 168 }; 169 in 170 clan-core.inputs.flake-parts.lib.mkFlake { inherit inputs; } { 171 systems = [ 172 "x86_64-linux" 173 "aarch64-linux" 174 "aarch64-darwin" 175 "x86_64-darwin" 176 ]; 177 imports = [ 178 ./formatter.nix 179 ./5pkgs/flake-module.nix 180 ./keys/flake-module.nix 181 ./wrapperModules/flake-module.nix 182 ./skills/flake-module.nix 183 ./games/flake-module.nix 184 ] 185 ++ ( 186 # Auto-import all flake-module.nix files from tools subdirectories 187 let 188 toolDirs = builtins.attrNames ( 189 nixpkgs.lib.filterAttrs (_: type: type == "directory") (builtins.readDir ./tools) 190 ); 191 in 192 map (dir: ./tools + "/${dir}/flake-module.nix") toolDirs 193 ); 194 flake.nixosConfigurations = clan.config.nixosConfigurations; 195 flake.clanInternals = clan.config.clanInternals; 196 flake.darwinConfigurations = clan.config.darwinConfigurations; 197 flake.clan = clan.config; 198 199 # Container configurations for use with extra-container 200 # Auto-discovers machines with container.nix 201 flake.containerConfigurations = 202 nixpkgs.lib.mapAttrs 203 (machineName: _: import ./machines/${machineName}/container.nix { inherit self; }) 204 ( 205 nixpkgs.lib.filterAttrs ( 206 machineName: _: builtins.pathExists ./machines/${machineName}/container.nix 207 ) (builtins.readDir ./machines) 208 ); 209 perSystem = 210 { 211 lib, 212 pkgs, 213 system, 214 ... 215 }: 216 { 217 packages = { 218 default = inputs.le_menu.lib.buildMenu { 219 inherit pkgs; 220 menuConfig = { 221 vim.run = "nix run ${self}#nvim"; 222 shell.run = "nix run ${self}#shell"; 223 machines.submenu = lib.mapAttrs (name: _machine: { 224 submenu.ssh.submenu = { 225 retiolum.run = "ssh -t ${name}.r"; 226 spora.run = "ssh ${name}.s"; 227 nether.run = "ssh ${name}.n"; 228 tor.run = "torify ssh $(pass show machines/${name}/tor-hostname)"; 229 }; 230 }) self.nixosConfigurations; 231 debug.run = "env"; 232 }; 233 }; 234 clan-cli = clan-core.packages.${system}.clan-cli; 235 } 236 // lib.mapAttrs' ( 237 name: containerConfig: 238 lib.nameValuePair "container-${name}" ( 239 inputs.extra-container.lib.buildContainers { 240 inherit system; 241 nixpkgs = inputs.nixpkgs; 242 config.containers.${name} = containerConfig; 243 } 244 ) 245 ) self.containerConfigurations; 246 devShells.default = pkgs.mkShell { 247 packages = [ 248 nixpkgs.legacyPackages.${system}.nil 249 nixpkgs.legacyPackages.${system}.nixd 250 self.packages.${pkgs.system}.pass 251 (self.legacyPackages.${system}.bin_shim { 252 name = "clan"; 253 pkg_name = "clan-cli"; 254 }) 255 ]; 256 }; 257 legacyPackages.llm = inputs.llm-agents.packages.${system}; 258 checks = 259 let 260 # Check NixOS configurations can be evaluated (without building) 261 nixosChecks = lib.mapAttrs' ( 262 name: config: 263 lib.nameValuePair "nixos-${name}" ( 264 pkgs.runCommand "eval-${name}" { } '' 265 # Force evaluation of the toplevel path without building 266 echo "Evaluating ${name}: ${builtins.unsafeDiscardStringContext config.config.system.build.toplevel.drvPath}" 267 touch $out 268 '' 269 ) 270 ) (lib.filterAttrs (_: config: config.pkgs.system == system) self.nixosConfigurations); 271 272 # Check Darwin configurations can be evaluated (without building) 273 darwinChecks = lib.mapAttrs' ( 274 name: config: 275 lib.nameValuePair "darwin-${name}" ( 276 pkgs.runCommand "eval-darwin-${name}" { } '' 277 # Force evaluation of the system path without building 278 echo "Evaluating ${name}: ${builtins.unsafeDiscardStringContext config.system.drvPath}" 279 touch $out 280 '' 281 ) 282 ) (lib.filterAttrs (_: config: config.pkgs.system == system) self.darwinConfigurations); 283 in 284 nixosChecks // darwinChecks; 285 }; 286 flake.lib = import ./lib { inherit (nixpkgs) lib; }; 287 }; 288}