Development environment with nix-shell: Difference between revisions
imported>Mickours Add direnv wiki link |
imported>Wucke13 Added note about Building locally in a nix-shell |
||
Line 64: | Line 64: | ||
More explanation and configuration tweak can be found in the Direnv wiki [https://github.com/direnv/direnv/wiki/Nix] | More explanation and configuration tweak can be found in the Direnv wiki [https://github.com/direnv/direnv/wiki/Nix] | ||
== Troubleshooting == | |||
When compiling software which links against local files (e.g. when compiling with rust's cargo), you may encounter the following problem: | |||
<syntaxHighlight lang=bash> | |||
= note: impure path `/[...]' used in link | |||
</syntaxHighlight> | |||
This happens due to a specialty in nix: <code>ld</code> is wrapped in a shell script which refuses to link against files not residing in the nix store, to ensure purity of builds. Obviously this is not useful when building locally, for example in your home directory. To disable this behavior simply set | |||
<syntaxHighlight lang=bash> | |||
NIX_ENFORCE_PURITY=0 | |||
</syntaxHighlight> | |||
in the nix-shell. |