This repository has no description
0

Configure Feed

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

core / flake.nix
22 kB 630 lines
1{ 2 description = "atproto github"; 3 4 inputs = { 5 nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05"; 6 microvm = { 7 url = "github:microvm-nix/microvm.nix"; 8 inputs.nixpkgs.follows = "nixpkgs"; 9 }; 10 fenix = { 11 url = "github:nix-community/fenix"; 12 inputs.nixpkgs.follows = "nixpkgs"; 13 }; 14 gomod2nix = { 15 url = "github:nix-community/gomod2nix"; 16 inputs.nixpkgs.follows = "nixpkgs"; 17 }; 18 flake-compat = { 19 url = "https://git.lix.systems/lix-project/flake-compat/archive/main.tar.gz"; 20 flake = false; 21 }; 22 indigo = { 23 url = "github:oppiliappan/indigo"; 24 flake = false; 25 }; 26 htmx-src = { 27 url = "https://unpkg.com/htmx.org@2.0.4/dist/htmx.min.js"; 28 flake = false; 29 }; 30 htmx-ws-src = { 31 # strange errors in console that i can't really make out 32 # url = "https://unpkg.com/htmx.org@2.0.4/dist/ext/ws.js"; 33 url = "https://cdn.jsdelivr.net/npm/htmx-ext-ws@2.0.2"; 34 flake = false; 35 }; 36 lucide-src = { 37 url = "https://github.com/lucide-icons/lucide/releases/download/0.536.0/lucide-icons-0.536.0.zip"; 38 flake = false; 39 }; 40 inter-fonts-src = { 41 url = "https://github.com/rsms/inter/releases/download/v4.1/Inter-4.1.zip"; 42 flake = false; 43 }; 44 actor-typeahead-src = { 45 url = "git+https://tangled.org/@jakelazaroff.com/actor-typeahead"; 46 flake = false; 47 }; 48 mermaid-src = { 49 url = "https://cdn.jsdelivr.net/npm/mermaid@11.12.3/dist/mermaid.min.js"; 50 flake = false; 51 }; 52 hls-src = { 53 url = "https://cdn.jsdelivr.net/npm/hls.js@1.5.13/dist/hls.min.js"; 54 flake = false; 55 }; 56 mathjax-src = { 57 url = "https://cdn.jsdelivr.net/npm/mathjax@4.1.2/tex-svg.js"; 58 flake = false; 59 }; 60 ibm-plex-mono-src = { 61 url = "https://github.com/IBM/plex/releases/download/%40ibm%2Fplex-mono%401.1.0/ibm-plex-mono.zip"; 62 flake = false; 63 }; 64 sqlite-lib-src = { 65 url = "https://sqlite.org/2024/sqlite-amalgamation-3450100.zip"; 66 flake = false; 67 }; 68 fetch-tangled = { 69 url = "git+https://tangled.org/isabelroses.com/fetch-tangled"; 70 inputs.nixpkgs.follows = "nixpkgs"; 71 }; 72 }; 73 74 outputs = { 75 self, 76 nixpkgs, 77 fenix, 78 gomod2nix, 79 indigo, 80 htmx-src, 81 htmx-ws-src, 82 lucide-src, 83 inter-fonts-src, 84 sqlite-lib-src, 85 ibm-plex-mono-src, 86 actor-typeahead-src, 87 mermaid-src, 88 hls-src, 89 microvm, 90 fetch-tangled, 91 mathjax-src, 92 ... 93 }: let 94 supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; 95 forAllSystems = nixpkgs.lib.genAttrs supportedSystems; 96 nixpkgsFor = forAllSystems (system: 97 import nixpkgs { 98 inherit system; 99 overlays = [fetch-tangled.overlays.default]; 100 }); 101 102 mkPackageSet = pkgs: 103 pkgs.lib.makeScope pkgs.newScope (self: { 104 src = let 105 fs = pkgs.lib.fileset; 106 in 107 fs.toSource { 108 root = ./.; 109 fileset = fs.difference (fs.intersection (fs.gitTracked ./.) (fs.fileFilter (file: !(file.hasExt "nix")) ./.)) (fs.maybeMissing ./.jj); 110 }; 111 rustSrc = let 112 fs = pkgs.lib.fileset; 113 in 114 fs.toSource { 115 root = ./.; 116 fileset = 117 fs.intersection 118 (fs.fromSource self.src) 119 (fs.unions [ 120 ./Cargo.toml 121 ./Cargo.lock 122 ./shuttle 123 ./bobbin 124 ]); 125 }; 126 buildGoApplication = 127 (self.callPackage "${gomod2nix}/builder" { 128 gomod2nix = gomod2nix.legacyPackages.${pkgs.stdenv.hostPlatform.system}.gomod2nix; 129 }).buildGoApplication; 130 rustPlatform = pkgs.makeRustPlatform { 131 inherit (fenix.packages.${pkgs.stdenv.hostPlatform.system}.stable) rustc cargo; 132 }; 133 rustPlatformStatic = let 134 system = pkgs.stdenv.hostPlatform.system; 135 muslTarget = pkgs.pkgsStatic.stdenv.hostPlatform.rust.rustcTarget; 136 toolchain = fenix.packages.${system}.combine [ 137 fenix.packages.${system}.stable.cargo 138 fenix.packages.${system}.stable.rustc 139 fenix.packages.${system}.targets.${muslTarget}.stable.rust-std 140 ]; 141 in 142 pkgs.pkgsStatic.makeRustPlatform { 143 cargo = toolchain; 144 rustc = toolchain; 145 }; 146 modules = ./nix/gomod2nix.toml; 147 sqlite-lib = self.callPackage ./nix/pkgs/sqlite-lib.nix { 148 inherit sqlite-lib-src; 149 }; 150 lexgen = self.callPackage ./nix/pkgs/lexgen.nix {inherit indigo;}; 151 goat = self.callPackage ./nix/pkgs/goat.nix {inherit indigo;}; 152 appview-static-files = self.callPackage ./nix/pkgs/appview-static-files.nix { 153 inherit htmx-src htmx-ws-src lucide-src inter-fonts-src ibm-plex-mono-src actor-typeahead-src mermaid-src hls-src mathjax-src; 154 }; 155 web-static-files = self.callPackage ./nix/pkgs/web-static-files.nix { 156 inherit inter-fonts-src ibm-plex-mono-src; 157 }; 158 appview = self.callPackage ./nix/pkgs/appview.nix {}; 159 blog = self.callPackage ./nix/pkgs/blog.nix {}; 160 docs = self.callPackage ./nix/pkgs/docs.nix { 161 inherit inter-fonts-src ibm-plex-mono-src lucide-src; 162 inherit (pkgs) pagefind; 163 }; 164 spindle = self.callPackage ./nix/pkgs/spindle.nix {}; 165 shuttle = self.callPackage ./nix/pkgs/shuttle.nix { 166 src = self.rustSrc; 167 }; 168 shuttle-static = self.callPackage ./nix/pkgs/shuttle.nix { 169 src = self.rustSrc; 170 rustPlatform = self.rustPlatformStatic; 171 }; 172 knot-unwrapped = self.callPackage ./nix/pkgs/knot-unwrapped.nix {}; 173 knot = self.callPackage ./nix/pkgs/knot.nix {}; 174 dolly = self.callPackage ./nix/pkgs/dolly.nix {}; 175 tap = self.callPackage ./nix/pkgs/tap.nix {}; 176 knotmirror = self.callPackage ./nix/pkgs/knotmirror.nix {}; 177 bobbin = self.callPackage ./nix/pkgs/bobbin.nix {}; 178 zoekt-webserver = self.callPackage ./nix/pkgs/zoekt-webserver.nix {}; 179 zoekt-tngl-indexserver = self.callPackage ./nix/pkgs/zoekt-tngl-indexserver.nix {}; 180 }); 181 in { 182 overlays.default = final: prev: { 183 inherit 184 (mkPackageSet final) 185 lexgen 186 goat 187 sqlite-lib 188 spindle 189 shuttle 190 knot-unwrapped 191 knot 192 appview 193 docs 194 dolly 195 tap 196 knotmirror 197 bobbin 198 zoekt-webserver 199 zoekt-tngl-indexserver 200 ; 201 }; 202 203 packages = forAllSystems (system: let 204 pkgs = nixpkgsFor.${system}; 205 linuxPkgs = nixpkgsFor."x86_64-linux"; 206 packages = mkPackageSet pkgs; 207 staticPackages = mkPackageSet pkgs.pkgsStatic; 208 crossPackages = mkPackageSet pkgs.pkgsCross.gnu64.pkgsStatic; 209 in { 210 inherit 211 (packages) 212 appview 213 appview-static-files 214 web-static-files 215 blog 216 lexgen 217 goat 218 spindle 219 knot 220 knot-unwrapped 221 sqlite-lib 222 docs 223 shuttle 224 shuttle-static 225 dolly 226 tap 227 knotmirror 228 bobbin 229 zoekt-webserver 230 zoekt-tngl-indexserver 231 ; 232 233 pkgsStatic-appview = staticPackages.appview; 234 pkgsStatic-knot = staticPackages.knot; 235 pkgsStatic-knot-unwrapped = staticPackages.knot-unwrapped; 236 pkgsStatic-spindle = staticPackages.spindle; 237 pkgsStatic-sqlite-lib = staticPackages.sqlite-lib; 238 pkgsStatic-dolly = staticPackages.dolly; 239 240 pkgsCross-gnu64-pkgsStatic-appview = crossPackages.appview; 241 pkgsCross-gnu64-pkgsStatic-knot = crossPackages.knot; 242 pkgsCross-gnu64-pkgsStatic-knot-unwrapped = crossPackages.knot-unwrapped; 243 pkgsCross-gnu64-pkgsStatic-spindle = crossPackages.spindle; 244 pkgsCross-gnu64-pkgsStatic-dolly = crossPackages.dolly; 245 246 treefmt-wrapper = pkgs.treefmt.withConfig { 247 settings.formatter = { 248 alejandra = { 249 command = pkgs.lib.getExe pkgs.alejandra; 250 includes = ["*.nix"]; 251 }; 252 253 gofmt = { 254 command = pkgs.lib.getExe' pkgs.go "gofmt"; 255 options = ["-w"]; 256 includes = ["*.go"]; 257 }; 258 259 rustfmt = { 260 command = pkgs.lib.getExe' fenix.packages.${system}.stable.rustfmt "rustfmt"; 261 options = ["--edition" "2024"]; 262 includes = ["*.rs"]; 263 excludes = ["**/src/_lex/**"]; 264 }; 265 266 prettier = { 267 command = pkgs.lib.getExe pkgs.prettier; 268 options = ["-w"]; 269 includes = [ 270 "web/**/*.cjs" 271 "web/**/*.css" 272 "web/**/*.html" 273 "web/**/*.js" 274 "web/**/*.json" 275 "web/**/*.json5" 276 "web/**/*.jsx" 277 "web/**/*.mdx" 278 "web/**/*.mjs" 279 "web/**/*.scss" 280 "web/**/*.ts" 281 "web/**/*.tsx" 282 "web/**/*.vue" 283 "web/**/*.yaml" 284 "web/**/*.yml" 285 ]; 286 }; 287 }; 288 }; 289 290 spindle-nixos-image = linuxPkgs.callPackage ./nix/pkgs/spindle-nixos-image.nix { 291 nixosSystem = self.nixosConfigurations.spindle-nixos; 292 }; 293 spindle-nixos-image-tarball = linuxPkgs.runCommand "spindle-nixos-image-tarball.tar.gz" {} '' 294 tar -S -C ${self.packages.${system}.spindle-nixos-image} -h -czf $out . 295 ''; 296 297 spindle-alpine-image = let 298 branch = "3.24"; 299 version = "${branch}.0"; 300 arch = "x86_64"; 301 cdn = "https://dl-cdn.alpinelinux.org/alpine/v${branch}/releases/${arch}"; 302 303 shuttle = (mkPackageSet linuxPkgs).shuttle-static; 304 in 305 linuxPkgs.callPackage ./nix/pkgs/spindle-alpine-image.nix { 306 inherit arch shuttle; 307 repositories = [ 308 "https://dl-cdn.alpinelinux.org/alpine/v${branch}/main" 309 "https://dl-cdn.alpinelinux.org/alpine/v${branch}/community" 310 ]; 311 rootfs = linuxPkgs.fetchurl { 312 url = "${cdn}/alpine-minirootfs-${version}-${arch}.tar.gz"; 313 hash = "sha256-3poRwODn6clNs+2K97RQ6vwLE2h71+kZnVUFDyCqCok="; 314 }; 315 kernel = linuxPkgs.fetchurl { 316 url = "${cdn}/netboot-${version}/vmlinuz-virt"; 317 hash = "sha256-Hmv5Ancgx1w+0NeRcfIbV5HuQMqXldB8fG4E3F6irpA="; 318 }; 319 initramfs = linuxPkgs.fetchurl { 320 url = "${cdn}/netboot-${version}/initramfs-virt"; 321 hash = "sha256-ZCWGSaVMOYOmLz1Gwsf2RhYarMqk+tFVA6MMDWiHVJQ="; 322 }; 323 modloop = linuxPkgs.fetchurl { 324 url = "${cdn}/netboot-${version}/modloop-virt"; 325 hash = "sha256-p3yO7yU28k04iT01sOzhDmEYi+Yl7VZs5r3RYsWCBX0="; 326 }; 327 }; 328 spindle-alpine-image-tarball = linuxPkgs.runCommand "spindle-alpine-image-tarball.tar.gz" {} '' 329 tar -S -C ${self.packages.${system}.spindle-alpine-image} -h -czf $out . 330 ''; 331 }); 332 defaultPackage = forAllSystems (system: self.packages.${system}.appview); 333 devShells = forAllSystems (system: let 334 pkgs = nixpkgsFor.${system}; 335 packages' = self.packages.${system}; 336 staticShell = args: 337 (pkgs.mkShell.override { 338 stdenv = pkgs.pkgsStatic.stdenv; 339 }) (args 340 // { 341 nativeBuildInputs = 342 args.nativeBuildInputs 343 ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ 344 pkgs.darwin.cctools 345 ]; 346 }); 347 in { 348 default = staticShell { 349 nativeBuildInputs = 350 [ 351 pkgs.go 352 pkgs.air 353 pkgs.gopls 354 pkgs.httpie 355 pkgs.litecli 356 pkgs.websocat 357 pkgs.tailwindcss 358 pkgs.nixos-shell 359 pkgs.redis 360 pkgs.worker-build 361 pkgs.cargo-generate 362 pkgs.qemu 363 pkgs.cdrkit 364 pkgs.buf 365 pkgs.protobuf 366 pkgs.protoc-gen-prost 367 pkgs.protoc-gen-prost-crate 368 pkgs.protoc-gen-prost-serde 369 pkgs.protoc-gen-go 370 (fenix.packages.${system}.combine [ 371 fenix.packages.${system}.stable.cargo 372 fenix.packages.${system}.stable.rustc 373 fenix.packages.${system}.stable.rust-src 374 fenix.packages.${system}.stable.clippy 375 fenix.packages.${system}.stable.rustfmt 376 fenix.packages.${system}.targets.wasm32-unknown-unknown.stable.rust-std 377 ]) 378 pkgs.coreutils # for those of us who are on systems that use busybox (alpine) 379 packages'.lexgen 380 packages'.treefmt-wrapper 381 packages'.tap 382 pkgs.e2fsprogs 383 pkgs.util-linux 384 pkgs.pnpm 385 ] 386 ++ pkgs.lib.optionals pkgs.stdenv.isLinux [ 387 pkgs.parted 388 pkgs.slirp4netns 389 pkgs.iproute2 390 ]; 391 shellHook = '' 392 export CC=${pkgs.stdenv.cc}/bin/cc 393 mkdir -p appview/pages/static 394 # temporary self-heal for workspaces that copied static assets as read-only 395 [ -d appview/pages/static/icons ] && [ ! -w appview/pages/static/icons ] && chmod -R u+rwX appview/pages/static 396 # no preserve is needed because watch-tailwind will want to be able to overwrite 397 cp -fr --no-preserve=ownership,mode ${packages'.appview-static-files}/* appview/pages/static 398 mkdir -p web/static 399 rm -rf web/static/fonts web/static/logos 400 cp -fr --no-preserve=ownership,mode ${packages'.web-static-files}/* web/static 401 export TANGLED_OAUTH_CLIENT_KID="$(date +%s)" 402 export TANGLED_OAUTH_CLIENT_SECRET="$(${packages'.goat}/bin/goat key generate -t P-256 | grep -A1 "Secret Key" | tail -n1 | awk '{print $1}')" 403 # Make xcrun (Nix stub) able to find ld from the system Command Line Tools. 404 # Without this, worker-build/cargo fails with "error: tool 'ld' not found". 405 if [ -d /Library/Developer/CommandLineTools/usr/bin ]; then 406 export PATH=/Library/Developer/CommandLineTools/usr/bin:$PATH 407 fi 408 ''; 409 env.CGO_ENABLED = 1; 410 }; 411 }); 412 apps = forAllSystems (system: let 413 pkgs = nixpkgsFor."${system}"; 414 packages' = self.packages.${system}; 415 air-watcher = name: arg: 416 pkgs.writeShellScriptBin "run" 417 '' 418 export PATH=${pkgs.go}/bin:$PATH 419 ${pkgs.air}/bin/air -c ./.air/${name}.toml \ 420 -build.args_bin "${arg}" 421 ''; 422 tailwind-watcher = 423 pkgs.writeShellScriptBin "run" 424 '' 425 export BROWSERSLIST_IGNORE_OLD_DATA=true 426 ${pkgs.tailwindcss}/bin/tailwindcss --watch=always -i input.css -o ./appview/pages/static/tw.css 427 ''; 428 in { 429 watch-appview = { 430 type = "app"; 431 program = toString (pkgs.writeShellScript "watch-appview" '' 432 echo "copying static files to appview/pages/static..." 433 mkdir -p appview/pages/static 434 ${pkgs.coreutils}/bin/cp -fr --no-preserve=ownership,mode ${packages'.appview-static-files}/* appview/pages/static 435 ${air-watcher "appview" ""}/bin/run 436 ''); 437 }; 438 watch-knot = { 439 type = "app"; 440 program = ''${air-watcher "knot" "server"}/bin/run''; 441 }; 442 watch-spindle = { 443 type = "app"; 444 program = ''${air-watcher "spindle" ""}/bin/run''; 445 }; 446 watch-blog = { 447 type = "app"; 448 program = toString (pkgs.writeShellScript "watch-blog" '' 449 echo "copying static files to appview/pages/static..." 450 mkdir -p appview/pages/static 451 ${pkgs.coreutils}/bin/cp -fr --no-preserve=ownership,mode ${packages'.appview-static-files}/* appview/pages/static 452 ${air-watcher "blog" "serve"}/bin/run 453 ''); 454 }; 455 watch-tailwind = { 456 type = "app"; 457 program = ''${tailwind-watcher}/bin/run''; 458 }; 459 serve-docs = { 460 type = "app"; 461 program = toString (pkgs.writeShellScript "serve-docs" '' 462 echo "building docs..." 463 docsOut=$(nix build --no-link --print-out-paths .#docs) 464 echo "serving docs at http://localhost:1414" 465 cd "$docsOut" 466 exec ${pkgs.python3}/bin/python3 -m http.server 1414 467 ''); 468 }; 469 regenerate-proto = { 470 type = "app"; 471 program = 472 (pkgs.writeShellApplication { 473 name = "regenerate-proto"; 474 runtimeInputs = with pkgs; [git buf coreutils]; 475 text = '' 476 rootDir=$(git rev-parse --show-toplevel 2>/dev/null || pwd) 477 cd "$rootDir" 478 echo ">>> regenerating protobuf files.." 479 buf generate 480 echo ">>> generating file descriptor set for shuttle..." 481 buf build -o shuttle/src/gen/file_descriptor_set.bin 482 echo ">>> done" 483 ''; 484 }) 485 + "/bin/regenerate-proto"; 486 }; 487 vm = let 488 guestSystem = 489 if pkgs.stdenv.hostPlatform.isAarch64 490 then "aarch64-linux" 491 else "x86_64-linux"; 492 in { 493 type = "app"; 494 program = 495 (pkgs.writeShellApplication { 496 name = "launch-vm"; 497 text = '' 498 rootDir=$(jj --ignore-working-copy root || git rev-parse --show-toplevel) || (echo "error: can't find repo root?"; exit 1) 499 cd "$rootDir" 500 501 # Reset TMPDIR in case it points to a stale nix-shell temp dir 502 export TMPDIR=/tmp 503 504 mkdir -p nix/vm-data/{knot,repos,spindle,spindle-logs} 505 506 export TANGLED_VM_DATA_DIR="$rootDir/nix/vm-data" 507 exec ${pkgs.lib.getExe 508 (import ./nix/vm.nix { 509 inherit nixpkgs self; 510 system = guestSystem; 511 hostSystem = system; 512 }).config.system.build.vm} 513 ''; 514 }) 515 + /bin/launch-vm; 516 }; 517 gomod2nix = { 518 type = "app"; 519 program = toString (pkgs.writeShellScript "gomod2nix" '' 520 ${gomod2nix.legacyPackages.${system}.gomod2nix}/bin/gomod2nix generate --outdir ./nix 521 ''); 522 }; 523 lexgen = { 524 type = "app"; 525 program = 526 (pkgs.writeShellApplication { 527 name = "lexgen"; 528 text = '' 529 if ! command -v lexgen > /dev/null; then 530 echo "error: must be executed from devshell" 531 exit 1 532 fi 533 534 rootDir=$(jj --ignore-working-copy root || git rev-parse --show-toplevel) || (echo "error: can't find repo root?"; exit 1) 535 cd "$rootDir" 536 537 # *_ext.go are hand-written extensions; never remove or mutate them 538 find api/tangled -maxdepth 1 -type f -not -name '*_ext.go' -delete 539 lexgen --build-file lexicon-build-config.json lexicons 540 541 # disable type registration temporarily while running cborgen 542 find api/tangled -maxdepth 1 -name '*.go' -not -name '*_ext.go' -exec \ 543 sed -i.bak 's/\tutil/\/\/\tutil/' {} + 544 # lexgen generates incomplete Marshaler/Unmarshaler for union types 545 find api/tangled -maxdepth 1 -name '*.go' -not -name '*_ext.go' -not -name "cbor_gen.go" -exec \ 546 sed -i '/^func.*\(MarshalCBOR\|UnmarshalCBOR\)/,/^}/ s/^/\/\/ /' {} + 547 for f in api/tangled/*_ext.go; do [ -e "''$f" ] && mv "''$f" "''$f.bak"; done 548 ${pkgs.gotools}/bin/goimports -w api/tangled/* 549 CGO_ENABLED=0 go run ./cmd/cborgen/ 550 for f in api/tangled/*_ext.go.bak; do [ -e "''$f" ] && mv "''$f" "''${f%.bak}"; done 551 552 lexgen --build-file lexicon-build-config.json lexicons 553 rm api/tangled/*.bak 554 ''; 555 }) 556 + /bin/lexgen; 557 }; 558 }); 559 560 nixosModules.appview = { 561 lib, 562 pkgs, 563 ... 564 }: { 565 imports = [./nix/modules/appview.nix]; 566 567 services.tangled.appview.package = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.appview; 568 }; 569 nixosModules.knotmirror = { 570 lib, 571 pkgs, 572 ... 573 }: { 574 imports = [./nix/modules/knotmirror.nix]; 575 576 services.tangled.knotmirror.tap-package = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.tap; 577 services.tangled.knotmirror.package = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.knotmirror; 578 }; 579 nixosModules.zoekt-tnglserver = { 580 lib, 581 pkgs, 582 ... 583 }: { 584 imports = [./nix/modules/zoekt-tnglserver.nix]; 585 586 services.tangled.zoekt.package = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.zoekt-tngl-indexserver; 587 services.tangled.zoekt.zoekt-webserver-package = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.zoekt-webserver; 588 }; 589 nixosModules.knot = { 590 lib, 591 pkgs, 592 ... 593 }: { 594 imports = [./nix/modules/knot.nix]; 595 596 services.tangled.knot.package = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.knot; 597 }; 598 nixosModules.spindle = { 599 lib, 600 pkgs, 601 ... 602 }: { 603 imports = [./nix/modules/spindle.nix]; 604 605 services.tangled.spindle.package = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.spindle; 606 }; 607 nixosModules.shuttle = { 608 lib, 609 pkgs, 610 ... 611 }: { 612 imports = [./nix/modules/shuttle.nix]; 613 614 services.tangled.shuttle.package = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.shuttle; 615 }; 616 617 nixosModules.spindle-nixos = import ./nix/microvm/spindle-vm.nix {inherit self microvm;} ./nix/microvm/qemu.nix; 618 619 formatter = forAllSystems (system: self.packages.${system}.treefmt-wrapper); 620 621 nixosConfigurations = let 622 spindleNixosBase = nixpkgs.lib.nixosSystem { 623 system = "x86_64-linux"; 624 modules = [self.nixosModules.spindle-nixos]; 625 }; 626 in { 627 spindle-nixos = spindleNixosBase; 628 }; 629 }; 630}