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