Monorepo for Tangled tangled.org
3

Configure Feed

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

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