Skip to content

Commit

Permalink
Run nix-shell with --pure when creating the .envrc
Browse files Browse the repository at this point in the history
This fixes a bug where the `.envrc` keeps growing every time you regenerate it.

By default, nix-shell gets the current $PATH and prepends the nix store $PATH. That means that if you already have the current `.envrc` loaded, both the current content of `.envrc` and the new computed path will be save to `.envrc`, making it grow over time. This is fixed by calling nix-shell with `--pure`.
  • Loading branch information
madjar committed Jun 23, 2020
1 parent 1b47825 commit 0dfc771
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/IHP/Makefile.dist
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ all: build/ihp-lib build/Generated/Types.hs

.envrc: default.nix ## Rebuild nix packages and .envrc
rm -f .envrc
echo "PATH_add $$(nix-shell -j auto --cores 0 --run 'echo $$PATH')" > .envrc
echo "PATH_add $$(nix-shell -j auto --cores 0 --pure --run 'echo $$PATH')" > .envrc
direnv allow

build/bin:
Expand Down

0 comments on commit 0dfc771

Please sign in to comment.