aboutsummaryrefslogtreecommitdiffstats
path: root/modules/by-name/di/direnv/pre-cache.sh
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-08-18 00:03:26 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-08-18 00:03:26 +0200
commit6aed3759f72cd65d76fecc1efbaf26fb0e8daa6e (patch)
tree5666c8a8ec1c3f5161927e278f4f97b0a4478698 /modules/by-name/di/direnv/pre-cache.sh
parentmodules/boot/tails-iso: Disable `config` kernel parameter (diff)
downloadnixos-config-6aed3759f72cd65d76fecc1efbaf26fb0e8daa6e.zip
modules/direnv: Don't depend on git, for the cache path creation
The nix fetched source, is a tarball, and as such has no git information, that we could extract.
Diffstat (limited to 'modules/by-name/di/direnv/pre-cache.sh')
-rwxr-xr-xmodules/by-name/di/direnv/pre-cache.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/by-name/di/direnv/pre-cache.sh b/modules/by-name/di/direnv/pre-cache.sh
index 13c0cd37..883689f1 100755
--- a/modules/by-name/di/direnv/pre-cache.sh
+++ b/modules/by-name/di/direnv/pre-cache.sh
@@ -7,12 +7,12 @@ _pre_cache_preflight() {
set -eu
_nix_direnv_preflight
- repo="%DEVSHELLS_REPO%"
+ REPO="%DEVSHELLS_REPO%"
system="x86_64-linux"
cache_dir="$XDG_CACHE_HOME/pre_cache"
[ -d "$cache_dir" ] || mkdir --parents "$cache_dir"
- repo_ref=$(git -C "$repo" rev-parse HEAD)
+ repo_ref="%DEVSHELLS_REPO_REF%"
final_cache="$cache_dir/$repo_ref"
if ! [ -d "$final_cache" ]; then
@@ -36,7 +36,7 @@ _pre_cache_load_shell() {
profile="$final_cache/__profile"
# It does not already exists, we need to evaluate it.
- _nix print-dev-env --profile "$tmp_profile" "$repo#$lang" >"$lang_cache"
+ _nix print-dev-env --profile "$tmp_profile" "$REPO#$lang" >"$lang_cache"
_nix_add_gcroot "$tmp_profile" "$profile"
rm "$tmp_profile" "$tmp_profile"*
@@ -50,7 +50,7 @@ _pre_cache_build_shells() {
installables=""
for lang in "$@"; do
- new_part="$repo#devShells.$system.$lang"
+ new_part="$REPO#devShells.$system.$lang"
if [ -z "$installables" ]; then
installables="$new_part"