File tree Expand file tree Collapse file tree 5 files changed +55
-1
lines changed
tests/modules/home-environment Expand file tree Collapse file tree 5 files changed +55
-1
lines changed Original file line number Diff line number Diff line change @@ -15,3 +15,9 @@ changes are only active if the `home.stateVersion` option is set to
1515
1616- The ` gtk.gtk4.theme ` option does not mirror ` gtk.theme ` by default
1717 anymore.
18+
19+ - The ` home.uid ` option is now required. When using Home Manager as a
20+ NixOS or nix-darwin module, this is automatically set from
21+ ` users.users.<name>.uid ` if that option is defined. For standalone
22+ usage or when the system user has no explicit UID, set ` home.uid `
23+ to your user's UID (run ` id -u ` to find it).
Original file line number Diff line number Diff line change 197197 type = types . nullOr types . ints . unsigned ;
198198 default = null ;
199199 example = 1000 ;
200- description = "The user's uid." ;
200+ description = ''
201+ The user's UID. Required for state version 26.05 and later.
202+
203+ When using Home Manager as a NixOS or nix-darwin module, this value
204+ is automatically set from {option}`users.users.<name>.uid` when that
205+ option is defined.
206+ '' ;
201207 } ;
202208
203209 home . homeDirectory = mkOption {
572578 assertion = config . home . homeDirectory != "" ;
573579 message = "Home directory could not be determined" ;
574580 }
581+ {
582+ assertion = lib . versionOlder config . home . stateVersion "26.05" || config . home . uid != null ;
583+ message = ''
584+ User ID (UID) could not be determined. Please set 'home.uid' to your
585+ user's UID. You can find your UID by running 'id -u' in your terminal.
586+
587+ If you are using Home Manager as a NixOS or nix-darwin module, you can
588+ alternatively set 'users.users.<name>.uid' in your system configuration.
589+ '' ;
590+ }
575591 ] ;
576592
577593 warnings =
Original file line number Diff line number Diff line change 1+ { config , lib , ... } :
2+
3+ {
4+ time = "2025-12-04T18:39:36+00:00" ;
5+ condition = lib . versionAtLeast config . home . stateVersion "26.05" ;
6+ message = ''
7+ The 'home.uid' option is now required for state version 26.05 and later.
8+
9+ When using Home Manager as a NixOS or nix-darwin module, this value is
10+ automatically set from 'users.users.<name>.uid' when that option is defined.
11+
12+ For standalone usage, or when the system user has no explicit UID, add to
13+ your configuration:
14+
15+ home.uid = 1000; # Replace with your actual UID (run 'id -u')
16+ '' ;
17+ }
Original file line number Diff line number Diff line change 55 home-nixpkgs-release-check-pkgs = ./nixpkgs-release-check-pkgs.nix ;
66 home-uid = ./uid.nix ;
77 home-uid-null = ./uid-null.nix ;
8+ home-uid-required = ./uid-required.nix ;
89}
Original file line number Diff line number Diff line change 1+ {
2+ home . stateVersion = "26.05" ;
3+ # home.uid defaults to null, which should trigger assertion for 26.05+
4+
5+ test . asserts . assertions . expected = [
6+ ''
7+ User ID (UID) could not be determined. Please set 'home.uid' to your
8+ user's UID. You can find your UID by running 'id -u' in your terminal.
9+
10+ If you are using Home Manager as a NixOS or nix-darwin module, you can
11+ alternatively set 'users.users.<name>.uid' in your system configuration.
12+ ''
13+ ] ;
14+ }
You can’t perform that action at this time.
0 commit comments