modules/common/user: refer to users.‹username›.name as the username#126
Open
GetPsyched wants to merge 1 commit intofeel-co:mainfrom
Open
modules/common/user: refer to users.‹username›.name as the username#126GetPsyched wants to merge 1 commit intofeel-co:mainfrom
GetPsyched wants to merge 1 commit intofeel-co:mainfrom
Conversation
GetPsyched
commented
Mar 21, 2026
| }; | ||
|
|
||
| name = mkOption { | ||
| default = name; |
Contributor
Author
There was a problem hiding this comment.
I've set a default here, but also in L98 (modules/nixos/base.nix). Either one of these is probably redundant. What should I do?
Member
There was a problem hiding this comment.
I'm under the impression that L98 in modules/nixos/base.nix is the redundant one, and it's also implicit. Technically, anyway.
However I do not see an issue with keeping both for the sake of consistency.
y0usaf
added a commit
to y0usaf/bayt
that referenced
this pull request
Mar 26, 2026
Add `bayt.users.‹key›.name` option that defaults to `users.users.‹key›.name`, allowing the attrset key to differ from the actual username. Fixes activation failures when users set a custom name in NixOS/darwin. Ref: feel-co#126
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hjem assumes that
usernameinhjem.users.‹username›is the actual username of the user, which is true in most cases, except whenusers.users.‹name›.nameis set to a different value.This causes
hjem-activate@to fail because it tries to determine the user based onattrNames hjem.users.This patch adds
hjem.users.‹username›.nameas a configurable option, and usesusers.users.nameas its default (nixos and nix-darwin alike).Note that I don't know if I've covered all of the places where a change should be made, which won't be obvious from the PR diff. Happy to go back and add changes in such places if so.
Sanity Checking
nix flake check/nix-build -A checks)nix fmt/nix run -f . formatter)x86_64-linuxaarch64-linuxx86_64-darwinaarch64-darwinAdd a 👍 reaction to pull requests you find important.