nix icon indicating copy to clipboard operation
nix copied to clipboard

nixosConfigurations, overlay from another flake, and --restrict-eval are incompatible

Open spacefrogg opened this issue 3 years ago • 0 comments

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

spacefrogg avatar Jan 31 '22 16:01 spacefrogg