···234234 "d /workspace/repo 0755 spindle-workflow spindle-workflow -"
235235 ];
236236237237+ # nix flake cache should go on the persisted dir, not the root (which is on tmpfs)
238238+ systemd.services.shuttle = {
239239+ environment.XDG_CACHE_HOME = "/var/cache/shuttle";
240240+ serviceConfig.CacheDirectory = "shuttle";
241241+ };
242242+237243 # add any common packages / services here
238244 environment.systemPackages = with pkgs; [
239245 gitMinimal
+19-3
spindle/engines/microvm/test-spindle-microvm.sh
···642642 local job='
643643env_file=/run/spindle/devshell-env.sh
644644[ -f "$env_file" ] && echo "env_file=present" || echo "env_file=missing"
645645+echo "shuttle_env=$(systemctl show shuttle -p Environment --value)"
646646+if [ -d /var/cache/shuttle ] && [ "$(stat -c %d /var/cache/shuttle)" = "$(stat -c %d /workspace)" ]; then
647647+ echo "shuttle_cache_on_persist=yes"
648648+else
649649+ echo "shuttle_cache_on_persist=no"
650650+fi
651651+if find /var/cache/shuttle/nix -mindepth 1 -print -quit 2>/dev/null | grep -q .; then
652652+ echo "shuttle_nix_cache_written=yes"
653653+else
654654+ echo "shuttle_nix_cache_written=no"
655655+fi
656656+657657+645658646659# mirror RunStep
647660. "$env_file"
···670683 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
671684672685 check_needles "$out" \
673673- "env_file=present" "pkgconfig=[0-9]" "openssl_found=yes" \
674674- "openssl_version=[0-9]" "dev_headers=found" "hello=Hello, world!" || return 1
686686+ "env_file=present" "shuttle_env=.*XDG_CACHE_HOME=/var/cache/shuttle" \
687687+ "shuttle_cache_on_persist=yes" "shuttle_nix_cache_written=yes" \
688688+ "pkgconfig=[0-9]" "openssl_found=yes" "openssl_version=[0-9]" \
689689+ "dev_headers=found" "hello=Hello, world!" || return 1
675690 echo "success: bare (pkg-config + openssl, dev headers found via PKG_CONFIG_PATH), flakeref, and aliased deps all resolved"
676691677692 # second run: same config + db, no upload. the devshell .drv is absent (no
···681696682697 check_needles "$out" \
683698 "realizing cached NixOS config" \
684684- "env_file=present" "pkgconfig=[0-9]" "openssl_found=yes" \
699699+ "env_file=present" "shuttle_env=.*XDG_CACHE_HOME=/var/cache/shuttle" \
700700+ "shuttle_cache_on_persist=yes" "pkgconfig=[0-9]" "openssl_found=yes" \
685701 "openssl_version=[0-9]" "dev_headers=found" "hello=Hello, world!" || return 1
686702 echo "success: cache-hit run re-read the devshell env from the cached profile (no drv) and all deps resolved"
687703}