make cache dir configurable

This commit is contained in:
EatThePooh 2025-12-17 15:31:37 +07:00
parent e50afb2a22
commit 4cef3f1fd0
3 changed files with 5 additions and 7 deletions

View file

@ -109,16 +109,12 @@ EOF
'';
denoWithCache =
{ baseDeno, sharedCache }:
{ baseDeno, sharedCache, dir }:
pkgs.writeShellScriptBin "deno" ''
set -euo pipefail
if [ -n "''${FLAKE_ROOT:-}" ]; then
CACHE_DIR="$FLAKE_ROOT/.deno_cache"
else
echo "FLAKE_ROOT not set. Make sure you're using the flake-root devShell." >&2
exit 1
fi
# Use configured dir, with support for FLAKE_ROOT variable expansion
CACHE_DIR="${dir}"
if [ ! -d "$CACHE_DIR" ] || [ ! "$(ls -A "$CACHE_DIR" 2>/dev/null)" ]; then
echo "Setting up Deno cache at: $CACHE_DIR" >&2