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 631 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 pkgs.nodejs 386 ] 387 ++ pkgs.lib.optionals pkgs.stdenv.isLinux [ 388 pkgs.parted 389 pkgs.slirp4netns 390 pkgs.iproute2 391 ]; 392 shellHook = '' 393 export CC=${pkgs.stdenv.cc}/bin/cc 394 mkdir -p appview/pages/static 395 # temporary self-heal for workspaces that copied static assets as read-only 396 [ -d appview/pages/static/icons ] && [ ! -w appview/pages/static/icons ] && chmod -R u+rwX appview/pages/static 397 # no preserve is needed because watch-tailwind will want to be able to overwrite 398 cp -fr --no-preserve=ownership,mode ${packages'.appview-static-files}/* appview/pages/static 399 mkdir -p web/static 400 rm -rf web/static/fonts web/static/logos 401 cp -fr --no-preserve=ownership,mode ${packages'.web-static-files}/* web/static 402 export TANGLED_OAUTH_CLIENT_KID="$(date +%s)" 403 export TANGLED_OAUTH_CLIENT_SECRET="$(${packages'.goat}/bin/goat key generate -t P-256 | grep -A1 "Secret Key" | tail -n1 | awk '{print $1}')" 404 # Make xcrun (Nix stub) able to find ld from the system Command Line Tools. 405 # Without this, worker-build/cargo fails with "error: tool 'ld' not found". 406 if [ -d /Library/Developer/CommandLineTools/usr/bin ]; then 407 export PATH=/Library/Developer/CommandLineTools/usr/bin:$PATH 408 fi 409 ''; 410 env.CGO_ENABLED = 1; 411 }; 412 }); 413 apps = forAllSystems (system: let 414 pkgs = nixpkgsFor."${system}"; 415 packages' = self.packages.${system}; 416 air-watcher = name: arg: 417 pkgs.writeShellScriptBin "run" 418 '' 419 export PATH=${pkgs.go}/bin:$PATH 420 ${pkgs.air}/bin/air -c ./.air/${name}.toml \ 421 -build.args_bin "${arg}" 422 ''; 423 tailwind-watcher = 424 pkgs.writeShellScriptBin "run" 425 '' 426 export BROWSERSLIST_IGNORE_OLD_DATA=true 427 ${pkgs.tailwindcss}/bin/tailwindcss --watch=always -i input.css -o ./appview/pages/static/tw.css 428 ''; 429 in { 430 watch-appview = { 431 type = "app"; 432 program = toString (pkgs.writeShellScript "watch-appview" '' 433 echo "copying static files to appview/pages/static..." 434 mkdir -p appview/pages/static 435 ${pkgs.coreutils}/bin/cp -fr --no-preserve=ownership,mode ${packages'.appview-static-files}/* appview/pages/static 436 ${air-watcher "appview" ""}/bin/run 437 ''); 438 }; 439 watch-knot = { 440 type = "app"; 441 program = ''${air-watcher "knot" "server"}/bin/run''; 442 }; 443 watch-spindle = { 444 type = "app"; 445 program = ''${air-watcher "spindle" ""}/bin/run''; 446 }; 447 watch-blog = { 448 type = "app"; 449 program = toString (pkgs.writeShellScript "watch-blog" '' 450 echo "copying static files to appview/pages/static..." 451 mkdir -p appview/pages/static 452 ${pkgs.coreutils}/bin/cp -fr --no-preserve=ownership,mode ${packages'.appview-static-files}/* appview/pages/static 453 ${air-watcher "blog" "serve"}/bin/run 454 ''); 455 }; 456 watch-tailwind = { 457 type = "app"; 458 program = ''${tailwind-watcher}/bin/run''; 459 }; 460 serve-docs = { 461 type = "app"; 462 program = toString (pkgs.writeShellScript "serve-docs" '' 463 echo "building docs..." 464 docsOut=$(nix build --no-link --print-out-paths .#docs) 465 echo "serving docs at http://localhost:1414" 466 cd "$docsOut" 467 exec ${pkgs.python3}/bin/python3 -m http.server 1414 468 ''); 469 }; 470 regenerate-proto = { 471 type = "app"; 472 program = 473 (pkgs.writeShellApplication { 474 name = "regenerate-proto"; 475 runtimeInputs = with pkgs; [git buf coreutils]; 476 text = '' 477 rootDir=$(git rev-parse --show-toplevel 2>/dev/null || pwd) 478 cd "$rootDir" 479 echo ">>> regenerating protobuf files.." 480 buf generate 481 echo ">>> generating file descriptor set for shuttle..." 482 buf build -o shuttle/src/gen/file_descriptor_set.bin 483 echo ">>> done" 484 ''; 485 }) 486 + "/bin/regenerate-proto"; 487 }; 488 vm = let 489 guestSystem = 490 if pkgs.stdenv.hostPlatform.isAarch64 491 then "aarch64-linux" 492 else "x86_64-linux"; 493 in { 494 type = "app"; 495 program = 496 (pkgs.writeShellApplication { 497 name = "launch-vm"; 498 text = '' 499 rootDir=$(jj --ignore-working-copy root || git rev-parse --show-toplevel) || (echo "error: can't find repo root?"; exit 1) 500 cd "$rootDir" 501 502 # Reset TMPDIR in case it points to a stale nix-shell temp dir 503 export TMPDIR=/tmp 504 505 mkdir -p nix/vm-data/{knot,repos,spindle,spindle-logs} 506 507 export TANGLED_VM_DATA_DIR="$rootDir/nix/vm-data" 508 exec ${pkgs.lib.getExe 509 (import ./nix/vm.nix { 510 inherit nixpkgs self; 511 system = guestSystem; 512 hostSystem = system; 513 }).config.system.build.vm} 514 ''; 515 }) 516 + /bin/launch-vm; 517 }; 518 gomod2nix = { 519 type = "app"; 520 program = toString (pkgs.writeShellScript "gomod2nix" '' 521 ${gomod2nix.legacyPackages.${system}.gomod2nix}/bin/gomod2nix generate --outdir ./nix 522 ''); 523 }; 524 lexgen = { 525 type = "app"; 526 program = 527 (pkgs.writeShellApplication { 528 name = "lexgen"; 529 text = '' 530 if ! command -v lexgen > /dev/null; then 531 echo "error: must be executed from devshell" 532 exit 1 533 fi 534 535 rootDir=$(jj --ignore-working-copy root || git rev-parse --show-toplevel) || (echo "error: can't find repo root?"; exit 1) 536 cd "$rootDir" 537 538 # *_ext.go are hand-written extensions; never remove or mutate them 539 find api/tangled -maxdepth 1 -type f -not -name '*_ext.go' -delete 540 lexgen --build-file lexicon-build-config.json lexicons 541 542 # disable type registration temporarily while running cborgen 543 find api/tangled -maxdepth 1 -name '*.go' -not -name '*_ext.go' -exec \ 544 sed -i.bak 's/\tutil/\/\/\tutil/' {} + 545 # lexgen generates incomplete Marshaler/Unmarshaler for union types 546 find api/tangled -maxdepth 1 -name '*.go' -not -name '*_ext.go' -not -name "cbor_gen.go" -exec \ 547 sed -i '/^func.*\(MarshalCBOR\|UnmarshalCBOR\)/,/^}/ s/^/\/\/ /' {} + 548 for f in api/tangled/*_ext.go; do [ -e "''$f" ] && mv "''$f" "''$f.bak"; done 549 ${pkgs.gotools}/bin/goimports -w api/tangled/* 550 CGO_ENABLED=0 go run ./cmd/cborgen/ 551 for f in api/tangled/*_ext.go.bak; do [ -e "''$f" ] && mv "''$f" "''${f%.bak}"; done 552 553 lexgen --build-file lexicon-build-config.json lexicons 554 rm api/tangled/*.bak 555 ''; 556 }) 557 + /bin/lexgen; 558 }; 559 }); 560 561 nixosModules.appview = { 562 lib, 563 pkgs, 564 ... 565 }: { 566 imports = [./nix/modules/appview.nix]; 567 568 services.tangled.appview.package = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.appview; 569 }; 570 nixosModules.knotmirror = { 571 lib, 572 pkgs, 573 ... 574 }: { 575 imports = [./nix/modules/knotmirror.nix]; 576 577 services.tangled.knotmirror.tap-package = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.tap; 578 services.tangled.knotmirror.package = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.knotmirror; 579 }; 580 nixosModules.zoekt-tnglserver = { 581 lib, 582 pkgs, 583 ... 584 }: { 585 imports = [./nix/modules/zoekt-tnglserver.nix]; 586 587 services.tangled.zoekt.package = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.zoekt-tngl-indexserver; 588 services.tangled.zoekt.zoekt-webserver-package = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.zoekt-webserver; 589 }; 590 nixosModules.knot = { 591 lib, 592 pkgs, 593 ... 594 }: { 595 imports = [./nix/modules/knot.nix]; 596 597 services.tangled.knot.package = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.knot; 598 }; 599 nixosModules.spindle = { 600 lib, 601 pkgs, 602 ... 603 }: { 604 imports = [./nix/modules/spindle.nix]; 605 606 services.tangled.spindle.package = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.spindle; 607 }; 608 nixosModules.shuttle = { 609 lib, 610 pkgs, 611 ... 612 }: { 613 imports = [./nix/modules/shuttle.nix]; 614 615 services.tangled.shuttle.package = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.shuttle; 616 }; 617 618 nixosModules.spindle-nixos = import ./nix/microvm/spindle-vm.nix {inherit self microvm;} ./nix/microvm/qemu.nix; 619 620 formatter = forAllSystems (system: self.packages.${system}.treefmt-wrapper); 621 622 nixosConfigurations = let 623 spindleNixosBase = nixpkgs.lib.nixosSystem { 624 system = "x86_64-linux"; 625 modules = [self.nixosModules.spindle-nixos]; 626 }; 627 in { 628 spindle-nixos = spindleNixosBase; 629 }; 630 }; 631}