Skip to content

Rebuild fails "error: cannot look up '<nixos-wsl/modules>' in pure evaluation mode" with flakes enabled #374

Answered by nzbr
JackTheMico asked this question in Q&A
Discussion options

You must be logged in to vote

It seems like you haven't added a nixos-wsl input to your flake. Channels do not work with flakes, because the flake inputs replace them. Your source files need to look like this:

flake.nix:

{
  description = "A very basic flake";
  
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
    nixos-wsl.url = "github:nix-community/nixos-wsl";
  };

  outputs = { self, nixpkgs, nixos-wsl }: {
     nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
       system = "x86_64-linux";
       modules = [
        ./configuration.nix
        nixos-wsl.nixosModules.wsl
       ];
     };
  };
}

configuration.nix:

# Edit this configuration file to define what should be installed on
# your…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@JackTheMico
Comment options

@573
Comment options

@nzbr
Comment options

nzbr Jan 10, 2024
Maintainer

Answer selected by nzbr
@benjaminrich
Comment options

@timblaktu
Comment options

@Yakumo-zi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants