nix
nix copied to clipboard
nixosConfigurations, overlay from another flake, and --restrict-eval are incompatible
Describe the bug
The following machine configuration does not evaluate in --restrict-eval mode, i.e. on Hydra:
{
inputs.overlay.url = "...";
outputs = { self, overlay, nixpkgs }: {
nixosConfigurations.machine = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
(_: {
nixpkgs.overlays = [ overlay.overlay ];
# more machine config...
})
];
};
};
}
It returns the error: error: access to absolute path '...' is forbidden in pure eval mode. The error is not limited to path URLs. It works for a flake-local overlay, though.
Steps To Reproduce
Create the above flake.nix file and run nix --restrict-eval build .#nixosConfigurations.machine.config.system.build.toplevel
Expected behavior
It should work like it does in unrestricted eval mode.
nix --version output
nix (Nix) 2.7.0pre20220131_59b6afe