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
When the module has been imported and no options are set, a rebuild can fail with "error: attribute 'nixos' missing".
This is due to 27679db causing cfg.defaultUser to be eagerly evaluated regardless of cfg.enable being false/the default.
This causes a rebuild failure when the user nixos doesn't exist.
To Reproduce
Import module and set no options.
Experience rebuild failure
Expected behavior
No rebuild failure
Logs
error: attribute 'nixos' missing
at /nix/store/pqfb6jic287q3d7s9jvz1w8lgrjnm3bi-source/modules/wsl-distro.nix:40:23:
39| inherit (cfg) automountPath;
40| defaultUser = config.users.users.${cfg.defaultUser};
| ^
41| };
… while evaluating the attribute 'uid' of the derivation 'syschdemd'
Additional Context
For simplicity, I have modules imported by all of the NixOS configurations I have in my configuration flake, and was confused to find that after bumping NixOS-WSL, the rebuild on my very-not-Windows laptop failed with a WSL-related issue.
The best solution would be to just not import the WSL module unless I absolutely need it, or to set defaultUser, but ideally the module wouldn't cause any problems by merely being imported, only when actually enabled.
The text was updated successfully, but these errors were encountered:
Infinidoge
changed the title
Module Can Cause Build Failures Even If Not Enabled
Module Can Cause System Build Failures Even If Not Enabled
Nov 1, 2022
Bug description
When the module has been imported and no options are set, a rebuild can fail with "error: attribute 'nixos' missing".
This is due to 27679db causing
cfg.defaultUser
to be eagerly evaluated regardless ofcfg.enable
being false/the default.This causes a rebuild failure when the user
nixos
doesn't exist.To Reproduce
Import module and set no options.
Experience rebuild failure
Expected behavior
No rebuild failure
Logs
Additional Context
For simplicity, I have modules imported by all of the NixOS configurations I have in my configuration flake, and was confused to find that after bumping NixOS-WSL, the rebuild on my very-not-Windows laptop failed with a WSL-related issue.
The best solution would be to just not import the WSL module unless I absolutely need it, or to set
defaultUser
, but ideally the module wouldn't cause any problems by merely being imported, only when actually enabled.The text was updated successfully, but these errors were encountered: