mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-09 02:21:05 +01:00
home-environment: add home.uid option
Add a home.uid option similar to home.username. When set, the activation script verifies the current UID matches the expected value using the new checkUid function. When using the NixOS or nix-darwin modules, home.uid is auto-discovered from users.users.<name>.uid when that value is set. This is useful for constructing paths that depend on the user's UID, such as /run/user/<uid> paths for gpg-agent sockets or other user-specific runtime directories.
This commit is contained in:
parent
d441981b20
commit
a521eab881
6 changed files with 38 additions and 0 deletions
7
tests/modules/home-environment/uid-null.nix
Normal file
7
tests/modules/home-environment/uid-null.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
# home.uid defaults to null, so checkUid should not be called in the activation script
|
||||
|
||||
nmt.script = ''
|
||||
assertFileNotRegex activate "checkUid [0-9]+"
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue