Skip to content

wsl battery forces inputs.nixos-wsl on flakes that don't use WSL #702

Closed

Description

@divyam234

After a routine flake inputs update, evaluating any of my NixOS hosts fails, even though none of them use WSL and I never enabled it anywhere.

Repro: flake using den.flakeModule with no nixos-wsl input, then:

nix eval .#nixosConfigurations.laptop.config.system.build.toplevel.drvPath --show-trace

gives:

error: attribute 'nixos-wsl' missing
at «github:denful/den/f88d635baecb9f9a82e8b78002cfd28e940c187b»/modules/aspects/batteries/wsl.nix:33:17:
    32|       defaultText = lib.literalExpression "inputs.nixos-wsl.nixosModules.default";
    33|       default = inputs.nixos-wsl.nixosModules.default;

Full trace goes through nixpkgs lib/modules.nix (checked options -> checkUnmatched -> ... -> matchedOptions) and ends at the default attribute above being forced during option checking. So every consumer without the input is broken, whether they use WSL or not.

Things I tried that did NOT help:

  • setting host.wsl.module explicitly per your docs ("or specify host.wsl.module"), with both lib.mkDefault { } and lib.mkForce { } — same error, the default itself gets evaluated regardless of definitions.

Expected: flakes that don't use WSL shouldn't need the nixos-wsl input. Either the default should only resolve when wsl.enable = true, or it should tolerate a missing input (e.g. fall back to null / { } when inputs has no nixos-wsl).

Versions: den f88d635, nixpkgs nixos-unstable e94cb152, nix 2.34.8.

Activity

  1. added a commit that references this issue on Sep 28, 2026
    71dff3a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions