1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00

Revert "nixos-module: Fix potential recursion between users.users and home-ma…" (#6745)

This reverts commit 216690777e.

Reverts #6622

Seems to be causing issues for other users, though. Will revert and we can try again with some tests in place.
This commit is contained in:
Austin Horstman 2025-04-01 09:52:10 -05:00 committed by GitHub
parent 55cf1f1632
commit 0afad8f080
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 19 deletions

View file

@ -50,13 +50,6 @@ let
};
in {
options.users.users = mkOption {
type = types.attrsOf (types.submodule ({ name, config, ... }: {
config.packages = mkIf ((config.enable or true) && cfg.useUserPackages
&& lib.hasAttr name cfg.users) [ cfg.users.${name}.home.path ];
}));
};
options.home-manager = {
useUserPackages = mkEnableOption ''
installation of user packages through the
@ -111,7 +104,10 @@ in {
};
config = (lib.mkMerge [
# Fix potential recursion when configuring home-manager users based on values in users.users #594
(mkIf (cfg.useUserPackages && cfg.users != { }) {
users.users = (lib.mapAttrs
(_username: usercfg: { packages = [ usercfg.home.path ]; }) cfg.users);
environment.pathsToLink = [ "/etc/profile.d" ];
})
(mkIf (cfg.users != { }) {