Monorepo for Tangled
0

Configure Feed

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

tangled-core / flake.nix
23 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 tailwindcss-animated-src = { 61 url = "https://registry.npmjs.org/tailwindcss-animated/-/tailwindcss-animated-1.1.2.tgz"; 62 flake = false; 63 }; 64 ibm-plex-mono-src = { 65 url = "https://github.com/IBM/plex/releases/download/%40ibm%2Fplex-mono%401.1.0/ibm-plex-mono.zip"; 66 flake = false; 67 }; 68 sqlite-lib-src = { 69 url = "https://sqlite.org/2024/sqlite-amalgamation-3450100.zip"; 70 flake = false; 71 }; 72 fetch-tangled = { 73 url = "git+https://tangled.org/isabelroses.com/fetch-tangled"; 74 inputs.nixpkgs.follows = "nixpkgs"; 75 }; 76 }; 77 78 outputs = { 79 self, 80 nixpkgs, 81 fenix, 82 gomod2nix, 83 indigo, 84 htmx-src, 85 htmx-ws-src, 86 lucide-src, 87 inter-fonts-src, 88 sqlite-lib-src, 89 ibm-plex-mono-src, 90 actor-typeahead-src, 91 mermaid-src, 92 hls-src, 93 microvm, 94 fetch-tangled, 95 mathjax-src, 96 tailwindcss-animated-src, 97 ... 98 }: let 99 supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; 100 forAllSystems = nixpkgs.lib.genAttrs supportedSystems; 101 nixpkgsFor = forAllSystems (system: 102 import nixpkgs { 103 inherit system; 104 overlays = [fetch-tangled.overlays.default]; 105 }); 106 107 mkPackageSet = pkgs: 108 pkgs.lib.makeScope pkgs.newScope (self: { 109 src = let 110 fs = pkgs.lib.fileset; 111 in 112 fs.toSource { 113 root = ./.; 114 fileset = fs.difference (fs.intersection (fs.gitTracked ./.) (fs.fileFilter (file: !(file.hasExt "nix")) ./.)) (fs.maybeMissing ./.jj); 115 }; 116 rustSrc = let 117 fs = pkgs.lib.fileset; 118 in 119 fs.toSource { 120 root = ./.; 121 fileset = 122 fs.intersection 123 (fs.fromSource self.src) 124 (fs.unions [ 125 ./Cargo.toml 126 ./Cargo.lock 127 ./shuttle 128 ./bobbin 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 appview = self.callPackage ./nix/pkgs/appview.nix {}; 161 blog = self.callPackage ./nix/pkgs/blog.nix {}; 162 docs = self.callPackage ./nix/pkgs/docs.nix { 163 inherit inter-fonts-src ibm-plex-mono-src lucide-src; 164 inherit (pkgs) pagefind; 165 }; 166 spindle = self.callPackage ./nix/pkgs/spindle.nix {}; 167 shuttle = self.callPackage ./nix/pkgs/shuttle.nix { 168 src = self.rustSrc; 169 }; 170 shuttle-static = self.callPackage ./nix/pkgs/shuttle.nix { 171 src = self.rustSrc; 172 rustPlatform = self.rustPlatformStatic; 173 }; 174 knot-unwrapped = self.callPackage ./nix/pkgs/knot-unwrapped.nix {}; 175 knot = self.callPackage ./nix/pkgs/knot.nix {}; 176 dolly = self.callPackage ./nix/pkgs/dolly.nix {}; 177 tap = self.callPackage ./nix/pkgs/tap.nix {}; 178 knotmirror = self.callPackage ./nix/pkgs/knotmirror.nix {}; 179 bobbin = self.callPackage ./nix/pkgs/bobbin.nix {}; 180 zoekt-webserver = self.callPackage ./nix/pkgs/zoekt-webserver.nix {}; 181 zoekt-tngl-indexserver = self.callPackage ./nix/pkgs/zoekt-tngl-indexserver.nix {}; 182 }); 183 in { 184 overlays.default = final: prev: { 185 inherit 186 (mkPackageSet final) 187 lexgen 188 goat 189 sqlite-lib 190 spindle 191 shuttle 192 knot-unwrapped 193 knot 194 appview 195 docs 196 dolly 197 tap 198 knotmirror 199 bobbin 200 zoekt-webserver 201 zoekt-tngl-indexserver 202 ; 203 }; 204 205 packages = forAllSystems (system: let 206 pkgs = nixpkgsFor.${system}; 207 linuxPkgs = nixpkgsFor."x86_64-linux"; 208 packages = mkPackageSet pkgs; 209 staticPackages = mkPackageSet pkgs.pkgsStatic; 210 crossPackages = mkPackageSet pkgs.pkgsCross.gnu64.pkgsStatic; 211 in { 212 inherit 213 (packages) 214 appview 215 appview-static-files 216 blog 217 lexgen 218 goat 219 spindle 220 knot 221 knot-unwrapped 222 sqlite-lib 223 docs 224 shuttle 225 shuttle-static 226 dolly 227 tap 228 knotmirror 229 bobbin 230 zoekt-webserver 231 zoekt-tngl-indexserver 232 ; 233 234 pkgsStatic-appview = staticPackages.appview; 235 pkgsStatic-knot = staticPackages.knot; 236 pkgsStatic-knot-unwrapped = staticPackages.knot-unwrapped; 237 pkgsStatic-spindle = staticPackages.spindle; 238 pkgsStatic-sqlite-lib = staticPackages.sqlite-lib; 239 pkgsStatic-dolly = staticPackages.dolly; 240 241 pkgsCross-gnu64-pkgsStatic-appview = crossPackages.appview; 242 pkgsCross-gnu64-pkgsStatic-knot = crossPackages.knot; 243 pkgsCross-gnu64-pkgsStatic-knot-unwrapped = crossPackages.knot-unwrapped; 244 pkgsCross-gnu64-pkgsStatic-spindle = crossPackages.spindle; 245 pkgsCross-gnu64-pkgsStatic-dolly = crossPackages.dolly; 246 247 treefmt-wrapper = pkgs.treefmt.withConfig { 248 settings.formatter = { 249 alejandra = { 250 command = pkgs.lib.getExe pkgs.alejandra; 251 includes = ["*.nix"]; 252 }; 253 254 gofmt = { 255 command = pkgs.lib.getExe' pkgs.go "gofmt"; 256 options = ["-w"]; 257 includes = ["*.go"]; 258 }; 259 260 rustfmt = { 261 command = pkgs.lib.getExe' fenix.packages.${system}.stable.rustfmt "rustfmt"; 262 options = ["--edition" "2024"]; 263 includes = ["*.rs"]; 264 excludes = ["**/src/_lex/**"]; 265 }; 266 267 # prettier = let 268 # wrapper = pkgs.runCommandLocal "prettier-wrapper" {nativeBuildInputs = [pkgs.makeWrapper];} '' 269 # makeWrapper ${pkgs.prettier}/bin/prettier "$out" --add-flags "--plugin=${pkgs.prettier-plugin-go-template}/lib/node_modules/prettier-plugin-go-template/lib/index.js" 270 # ''; 271 # in { 272 # command = wrapper; 273 # options = ["-w"]; 274 # includes = ["*.html"]; 275 # # causes Go template plugin errors: https://github.com/NiklasPor/prettier-plugin-go-template/issues/120 276 # excludes = ["appview/pages/templates/layouts/repobase.html" "appview/pages/templates/repo/tags.html"]; 277 # }; 278 }; 279 }; 280 281 spindle-nixos-image = linuxPkgs.callPackage ./nix/pkgs/spindle-nixos-image.nix { 282 nixosSystem = self.nixosConfigurations.spindle-nixos; 283 }; 284 spindle-nixos-image-tarball = linuxPkgs.runCommand "spindle-nixos-image-tarball.tar.gz" {} '' 285 tar -S -C ${self.packages.${system}.spindle-nixos-image} -h -czf $out . 286 ''; 287 288 spindle-alpine-image = let 289 branch = "3.24"; 290 version = "${branch}.0"; 291 arch = "x86_64"; 292 cdn = "https://dl-cdn.alpinelinux.org/alpine/v${branch}/releases/${arch}"; 293 294 shuttle = (mkPackageSet linuxPkgs).shuttle-static; 295 in 296 linuxPkgs.callPackage ./nix/pkgs/spindle-alpine-image.nix { 297 inherit arch shuttle; 298 repositories = [ 299 "https://dl-cdn.alpinelinux.org/alpine/v${branch}/main" 300 "https://dl-cdn.alpinelinux.org/alpine/v${branch}/community" 301 ]; 302 rootfs = linuxPkgs.fetchurl { 303 url = "${cdn}/alpine-minirootfs-${version}-${arch}.tar.gz"; 304 hash = "sha256-3poRwODn6clNs+2K97RQ6vwLE2h71+kZnVUFDyCqCok="; 305 }; 306 kernel = linuxPkgs.fetchurl { 307 url = "${cdn}/netboot-${version}/vmlinuz-virt"; 308 hash = "sha256-Hmv5Ancgx1w+0NeRcfIbV5HuQMqXldB8fG4E3F6irpA="; 309 }; 310 initramfs = linuxPkgs.fetchurl { 311 url = "${cdn}/netboot-${version}/initramfs-virt"; 312 hash = "sha256-ZCWGSaVMOYOmLz1Gwsf2RhYarMqk+tFVA6MMDWiHVJQ="; 313 }; 314 modloop = linuxPkgs.fetchurl { 315 url = "${cdn}/netboot-${version}/modloop-virt"; 316 hash = "sha256-p3yO7yU28k04iT01sOzhDmEYi+Yl7VZs5r3RYsWCBX0="; 317 }; 318 }; 319 spindle-alpine-image-tarball = linuxPkgs.runCommand "spindle-alpine-image-tarball.tar.gz" {} '' 320 tar -S -C ${self.packages.${system}.spindle-alpine-image} -h -czf $out . 321 ''; 322 }); 323 defaultPackage = forAllSystems (system: self.packages.${system}.appview); 324 devShells = forAllSystems (system: let 325 pkgs = nixpkgsFor.${system}; 326 packages' = self.packages.${system}; 327 tailwindcss-plugins = pkgs.linkFarm "tailwindcss-plugins" [ 328 { 329 name = "tailwindcss-animated"; 330 path = tailwindcss-animated-src; 331 } 332 ]; 333 staticShell = args: 334 (pkgs.mkShell.override { 335 stdenv = pkgs.pkgsStatic.stdenv; 336 }) (args 337 // { 338 nativeBuildInputs = 339 args.nativeBuildInputs 340 ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ 341 pkgs.darwin.cctools 342 ]; 343 }); 344 in { 345 default = staticShell { 346 nativeBuildInputs = 347 [ 348 pkgs.go 349 pkgs.air 350 pkgs.gopls 351 pkgs.httpie 352 pkgs.litecli 353 pkgs.websocat 354 pkgs.tailwindcss 355 pkgs.nixos-shell 356 pkgs.redis 357 pkgs.worker-build 358 pkgs.cargo-generate 359 pkgs.qemu 360 pkgs.cdrkit 361 pkgs.buf 362 pkgs.protobuf 363 pkgs.protoc-gen-prost 364 pkgs.protoc-gen-prost-crate 365 pkgs.protoc-gen-prost-serde 366 pkgs.protoc-gen-go 367 (fenix.packages.${system}.combine [ 368 fenix.packages.${system}.stable.cargo 369 fenix.packages.${system}.stable.rustc 370 fenix.packages.${system}.stable.rust-src 371 fenix.packages.${system}.stable.clippy 372 fenix.packages.${system}.stable.rustfmt 373 fenix.packages.${system}.targets.wasm32-unknown-unknown.stable.rust-std 374 ]) 375 pkgs.coreutils # for those of us who are on systems that use busybox (alpine) 376 packages'.lexgen 377 packages'.treefmt-wrapper 378 packages'.tap 379 pkgs.e2fsprogs 380 pkgs.util-linux 381 ] 382 ++ pkgs.lib.optionals pkgs.stdenv.isLinux [ 383 pkgs.parted 384 pkgs.slirp4netns 385 pkgs.iproute2 386 ]; 387 shellHook = '' 388 export CC=${pkgs.stdenv.cc}/bin/cc 389 export NODE_PATH=${tailwindcss-plugins}''${NODE_PATH:+:$NODE_PATH} 390 mkdir -p appview/pages/static 391 # temporary self-heal for workspaces that copied static assets as read-only 392 [ -d appview/pages/static/icons ] && [ ! -w appview/pages/static/icons ] && chmod -R u+rwX appview/pages/static 393 # no preserve is needed because watch-tailwind will want to be able to overwrite 394 cp -fr --no-preserve=ownership,mode ${packages'.appview-static-files}/* appview/pages/static 395 export TANGLED_OAUTH_CLIENT_KID="$(date +%s)" 396 export TANGLED_OAUTH_CLIENT_SECRET="$(${packages'.goat}/bin/goat key generate -t P-256 | grep -A1 "Secret Key" | tail -n1 | awk '{print $1}')" 397 # Make xcrun (Nix stub) able to find ld from the system Command Line Tools. 398 # Without this, worker-build/cargo fails with "error: tool 'ld' not found". 399 if [ -d /Library/Developer/CommandLineTools/usr/bin ]; then 400 export PATH=/Library/Developer/CommandLineTools/usr/bin:$PATH 401 fi 402 ''; 403 env.CGO_ENABLED = 1; 404 }; 405 }); 406 apps = forAllSystems (system: let 407 pkgs = nixpkgsFor."${system}"; 408 packages' = self.packages.${system}; 409 tailwindcss-plugins = pkgs.linkFarm "tailwindcss-plugins" [ 410 { 411 name = "tailwindcss-animated"; 412 path = tailwindcss-animated-src; 413 } 414 ]; 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 export NODE_PATH=${tailwindcss-plugins} 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}