-
-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NixOS users.users.<user> attribute name and .name can differ #147
NixOS users.users.<user> attribute name and .name can differ #147
Conversation
Looks good. Thank you! |
Before always including the wsl module worked but now it errors:
I expect that changing the name of the default user no longer works in some situations eg when it is only created by users.users below. |
I guess you don't have a NixOS-WSL/modules/wsl-distro.nix Line 98 in 27679db
|
Yes, I set |
Hmm I've tried creating a simple test case at https://github.com/KoviRobi/nixos-wsl-test and the following works
Also nix-repl> :lf github:KoviRobi/nixos-wsl-test
Added 10 variables.
nix-repl> builtins.attrNames nixosConfigurations.wsl-test.config.users.users
[ "messagebus" "nixbld1" "nixbld10" "nixbld11" "nixbld12" "nixbld13" "nixbld14" "nixbld15" "nixbld16" "nixbld17" "nixbld18" "nixbld19" "nixbld2" "nixbld20" "nixbld21" "nixbld22" "nixbld23" "nixbld24" "nixbld25" "nixbld26" "nixbld27" "nixbld28" "nixbld29" "nixbld3" "nixbld30" "nixbld31" "nixbld32" "nixbld4" "nixbld5" "nixbld6" "nixbld7" "nixbld8" "nixbld9" "nobody" "nscd" "root" "systemd-coredump" "systemd-journal-gateway" "systemd-network" "systemd-oom" "systemd-resolve" "systemd-timesync" "test" ] has no user Maybe you can provide a minimal example? |
Found the problem. Setting |
* upstream/main: Fix syschdemd exit code (nix-community#140) update remaining references to wsl.automountPath (nix-community#158) Update flakes (nix-community#124) wsl.conf: proper option types (nix-community#153) Fix eval by disabling module completely when wsl.enable = false (nix-community#151) NixOS users.users.<user> attribute name and .name can differ (nix-community#147) switch nixpkgs.overlays to inline overlay (nix-community#150) feat: native systemd support (nix-community#134) remove boot.isContainer (nix-community#145) Do not import minimal profile by default (nix-community#144)
This is admittedly a niche use case, they are the same most of the time, but on my computer for historical purposes I have
users.users.default-user
which has a different.name
depending on whether Nix is building my work configuration or uni configuration (hence why it'sdefault-user
).