FAQ: Difference between revisions
imported>Dezgeg Comment out dangerous suggestions of mounting /nix/store rw |
imported>Mic92 No edit summary |
||
| Line 227: | Line 227: | ||
<syntaxhighlight lang="bash">nix-instantiate --find-file nixpkgs</syntaxhighlight> | <syntaxhighlight lang="bash">nix-instantiate --find-file nixpkgs</syntaxhighlight> | ||
To know the commit, open the .version-suffix file in the nixpkgs location. The hash after the dot is the git commit. | To know the commit, open the .version-suffix file in the nixpkgs location. The hash after the dot is the git commit. | ||
== An error occurs while fetching sources from an url, how do I fix it? == | == An error occurs while fetching sources from an url, how do I fix it? == | ||
| Line 252: | Line 250: | ||
Be sure to [https://github.com/NixOS/nixpkgs/issues report the incorrect url] or [https://github.com/NixOS/nixpkgs/pulls fix it yourself]. | Be sure to [https://github.com/NixOS/nixpkgs/issues report the incorrect url] or [https://github.com/NixOS/nixpkgs/pulls fix it yourself]. | ||
== How do I know the sha256 to use with fetchgit/fetchsvn/fetchbzr/fetchcvs? == | == How do I know the sha256 to use with fetchgit/fetchsvn/fetchbzr/fetchcvs? == | ||
| Line 275: | Line 272: | ||
<syntaxhighlight lang="bash">nixos-rebuild switch --option binary-caches ""</syntaxhighlight> | <syntaxhighlight lang="bash">nixos-rebuild switch --option binary-caches ""</syntaxhighlight> | ||
== How do I enable | == How do I enable sandboxed builds on non-NixOS? == | ||
Two options have to be added to make | Two options have to be added to make sandboxed builds work on Nix, ''build-use-sandbox'' and ''build-sandbox-paths'': | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
# /etc/nix/nix.conf | # /etc/nix/nix.conf | ||
build-use- | build-use-sandbox = true | ||
build- | build-sandbox-paths = $(nix-store -qR $(nix-build '<nixpkgs>' -A bash) | xargs echo /bin/sh=$(nix-build '<nixpkgs>' -A bash)/bin/bash) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
On NixOS set the following in ''configuration.nix'': | On NixOS set the following in ''configuration.nix'': | ||
| Line 290: | Line 286: | ||
nix.useSandbox = true; | nix.useSandbox = true; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
See [[Nix Package Manager#Sandbox_builds]] for more details. | |||
== I cannot find $package when running <code>nix-env -qaP</code> even with channels configured == | == I cannot find $package when running <code>nix-env -qaP</code> even with channels configured == | ||