direnv: fix dump
authorJulien Moutinho <julm@sourcephile.fr>
Mon, 2 Mar 2020 13:42:41 +0000 (14:42 +0100)
committerJulien Moutinho <julm@sourcephile.fr>
Mon, 2 Mar 2020 13:42:41 +0000 (14:42 +0100)
.envrc

diff --git a/.envrc b/.envrc
index 111cab0e83c1debc9e066832e82cb14fea2941d9..f47a9f3805265d9e5a0aea032066a3c08e37045d 100644 (file)
--- a/.envrc
+++ b/.envrc
@@ -57,6 +57,7 @@ for e in "${nixshell_sources[@]}"
 do watch_file "$e"; done
 hash=$(shasum -a 256 "${nixshell_sources[@]}" | shasum -a 256 | cut -c -64)
 cache=.cache/nix-shell/"$hash"
+unset DIRENV_DUMP_FILE_PATH
 if test -e "$cache/dump"
 then
   log_status "reusing $cache/"
@@ -83,8 +84,8 @@ else
   nix-store >/dev/null --indirect --add-root "$cache"/shell.dep \
    --realise $(nix-store --query --references $cache/shell.drv) \
    ${OFFLINE:+--option substituters ""} &&
-  direnv_load sh -c "nix-shell ${TRACE:+--show-trace} --pure \
-   --run \"$direnv dump | tee $cache/dump >\$DIRENV_DUMP_FILE_PATH\" \
+  direnv_load sh -c "nix-shell ${TRACE:+--show-trace} \
+   --run \"DIRENV_DUMP_FILE_PATH= $direnv dump | tee $cache/dump >\$DIRENV_DUMP_FILE_PATH\" \
    ${OFFLINE:+--option substituters ""}" &&
   find .cache/nix-shell -mindepth 1 -maxdepth 1 -not -name "$hash" -exec rm -rf {} + || {
     rm -rf "$PWD/.cache/nix-shell/$hash"