You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that recent versions of Nix have tightened pure evaluation mode. In the flake below, I pass a store path to a function from another flake, which used to work in older versions of Nix.
To reproduce, run nix build on the following flake:
{description="Pass a store path to a flake";inputs={nixpkgs.url="github:nixos/nixpkgs";nix-freeze-tree.url="git+https://git.sr.ht/~jack/nix-freeze-tree?rev=60e09710d6062d54d063c8488337c14d9d302d58";};outputs=inputs: {packages.x86_64-linux.default=letpkgs=inputs.nixpkgs.legacyPackages.x86_64-linux;step1=pkgs.runCommand"step1"{}'' mkdir -p $out echo '19 + 23' > $out/theanswer '';step2=inputs.nix-freeze-tree.lib.x86_64-linux.freezestep1;instep2;};}
You should see error: access to absolute path '/nix/store/bhgy1rz0hi7b9anbnyr6zjgp0jh5dwrg-step1' is forbidden in pure evaluation mode (use '--impure' to override).
The text was updated successfully, but these errors were encountered:
Affected releases (non-exhaustive): Nix 2.20.6, Nix 2.21.2, Nix 2.22.1
Last unaffected release: Nix 2.19.4
It appears that recent versions of Nix have tightened pure evaluation mode. In the flake below, I pass a store path to a function from another flake, which used to work in older versions of Nix.
To reproduce, run
nix build
on the following flake:You should see
error: access to absolute path '/nix/store/bhgy1rz0hi7b9anbnyr6zjgp0jh5dwrg-step1' is forbidden in pure evaluation mode (use '--impure' to override)
.The text was updated successfully, but these errors were encountered: