forked from lix-project/lix
Maximilian Bosch
e6a360a4d9
As described in #4745 it's otherwise fairly hard to understand where this is coming from. Say you have an expression which uses e.g. `types.package`: ``` nix { outputs = { self, nixpkgs }: { packages.x86_64-linux.hello = let foo = nixpkgs.lib.evalModules { modules = [ { options.foo.bar = with nixpkgs.lib; mkOption { type = types.package; }; } { foo.bar = ./.; } ]; }; in builtins.trace foo.config.foo.bar.outPath nixpkgs.legacyPackages.x86_64-linux.hello; defaultPackage.x86_64-linux = self.packages.x86_64-linux.hello; }; } ``` Then you'll get an error trace like this: ``` error: 'builtins.storePath' is not allowed in pure evaluation mode at /nix/store/p4h2x6r80njkb0j2rc1xjhhl99yri3zb-source/lib/attrsets.nix:328:15: 327| let 328| path' = builtins.storePath path; | ^ 329| res = … while evaluating the attribute 'config.foo.bar.outPath' at /nix/store/p4h2x6r80njkb0j2rc1xjhhl99yri3zb-source/lib/attrsets.nix:332:11: 331| name = sanitizeDerivationName (builtins.substring 33 (-1) (baseNameOf path')); 332| outPath = path'; | ^ 333| outputs = [ "out" ]; … while evaluating the attribute 'packages.x86_64-linux.hello' at /nix/store/6c1rfsqzrhjw1235palzjmf5vihcpci7-source/flake.nix:3:5: 2| { outputs = { self, nixpkgs }: { 3| packages.x86_64-linux.hello = let | ^ 4| foo = nixpkgs.lib.evalModules { ``` Fixes #4745 |
||
---|---|---|
.github | ||
config | ||
contrib | ||
doc/manual | ||
m4 | ||
maintainers | ||
misc | ||
mk | ||
nix-rust | ||
perl | ||
scripts | ||
src | ||
tests | ||
.dir-locals.el | ||
.editorconfig | ||
.gitignore | ||
.version | ||
bootstrap.sh | ||
configure.ac | ||
COPYING | ||
default.nix | ||
flake.lock | ||
flake.nix | ||
local.mk | ||
Makefile | ||
Makefile.config.in | ||
precompiled-headers.h | ||
README.md | ||
shell.nix |
Nix
Nix is a powerful package manager for Linux and other Unix systems that makes package management reliable and reproducible. Please refer to the Nix manual for more details.
Installation
On Linux and macOS the easiest way to install Nix is to run the following shell command (as a user other than root):
$ curl -L https://nixos.org/nix/install | sh
Information on additional installation methods is available on the Nix download page.
Building And Developing
See our Hacking guide in our manual for instruction on how to build nix from source with nix-build or how to get a development environment.
Additional Resources
License
Nix is released under the LGPL v2.1.