1
0
Fork 0
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:
Bernardo Meurer 2025-12-03 22:52:03 +00:00 committed by Matthieu Coudron
parent d441981b20
commit a521eab881
6 changed files with 38 additions and 0 deletions

View 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]+"
'';
}