Monorepo for Tangled
0

Configure Feed

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

spindle/microvm: put shuttle XDG_CACHE_HOME to disk backed dir

Signed-off-by: dawn <dawn@tangled.org>

dawn (Jul 4, 2026, 9:18 PM +0300) bce1d790 b4261269

+25 -3
+6
nix/microvm/base.nix
··· 234 234 "d /workspace/repo 0755 spindle-workflow spindle-workflow -" 235 235 ]; 236 236 237 + # nix flake cache should go on the persisted dir, not the root (which is on tmpfs) 238 + systemd.services.shuttle = { 239 + environment.XDG_CACHE_HOME = "/var/cache/shuttle"; 240 + serviceConfig.CacheDirectory = "shuttle"; 241 + }; 242 + 237 243 # add any common packages / services here 238 244 environment.systemPackages = with pkgs; [ 239 245 gitMinimal
+19 -3
spindle/engines/microvm/test-spindle-microvm.sh
··· 642 642 local job=' 643 643 env_file=/run/spindle/devshell-env.sh 644 644 [ -f "$env_file" ] && echo "env_file=present" || echo "env_file=missing" 645 + echo "shuttle_env=$(systemctl show shuttle -p Environment --value)" 646 + if [ -d /var/cache/shuttle ] && [ "$(stat -c %d /var/cache/shuttle)" = "$(stat -c %d /workspace)" ]; then 647 + echo "shuttle_cache_on_persist=yes" 648 + else 649 + echo "shuttle_cache_on_persist=no" 650 + fi 651 + if find /var/cache/shuttle/nix -mindepth 1 -print -quit 2>/dev/null | grep -q .; then 652 + echo "shuttle_nix_cache_written=yes" 653 + else 654 + echo "shuttle_nix_cache_written=no" 655 + fi 656 + 657 + 645 658 646 659 # mirror RunStep 647 660 . "$env_file" ··· 670 683 out=$(run_vm --name "activation-dependencies" --timeout "600s" --activate "$config" --db "$db_path" --upload -- /run/current-system/sw/bin/bash -l -c "$job") || return 1 671 684 672 685 check_needles "$out" \ 673 - "env_file=present" "pkgconfig=[0-9]" "openssl_found=yes" \ 674 - "openssl_version=[0-9]" "dev_headers=found" "hello=Hello, world!" || return 1 686 + "env_file=present" "shuttle_env=.*XDG_CACHE_HOME=/var/cache/shuttle" \ 687 + "shuttle_cache_on_persist=yes" "shuttle_nix_cache_written=yes" \ 688 + "pkgconfig=[0-9]" "openssl_found=yes" "openssl_version=[0-9]" \ 689 + "dev_headers=found" "hello=Hello, world!" || return 1 675 690 echo "success: bare (pkg-config + openssl, dev headers found via PKG_CONFIG_PATH), flakeref, and aliased deps all resolved" 676 691 677 692 # second run: same config + db, no upload. the devshell .drv is absent (no ··· 681 696 682 697 check_needles "$out" \ 683 698 "realizing cached NixOS config" \ 684 - "env_file=present" "pkgconfig=[0-9]" "openssl_found=yes" \ 699 + "env_file=present" "shuttle_env=.*XDG_CACHE_HOME=/var/cache/shuttle" \ 700 + "shuttle_cache_on_persist=yes" "pkgconfig=[0-9]" "openssl_found=yes" \ 685 701 "openssl_version=[0-9]" "dev_headers=found" "hello=Hello, world!" || return 1 686 702 echo "success: cache-hit run re-read the devshell env from the cached profile (no drv) and all deps resolved" 687 703 }