mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 03:30:45 +00:00
Merge pull request #132836 from Infinisil/populate-members
nixos/users: Populate group members option
This commit is contained in:
commit
1ad73dadd2
|
@ -324,7 +324,7 @@ let
|
|||
|
||||
};
|
||||
|
||||
groupOpts = { name, ... }: {
|
||||
groupOpts = { name, config, ... }: {
|
||||
|
||||
options = {
|
||||
|
||||
|
@ -358,6 +358,10 @@ let
|
|||
|
||||
config = {
|
||||
name = mkDefault name;
|
||||
|
||||
members = mapAttrsToList (n: u: u.name) (
|
||||
filterAttrs (n: u: elem config.name u.extraGroups) cfg.users
|
||||
);
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -419,12 +423,7 @@ let
|
|||
initialPassword initialHashedPassword;
|
||||
shell = utils.toShellPath u.shell;
|
||||
}) cfg.users;
|
||||
groups = mapAttrsToList (n: g:
|
||||
{ inherit (g) name gid;
|
||||
members = g.members ++ (mapAttrsToList (n: u: u.name) (
|
||||
filterAttrs (n: u: elem g.name u.extraGroups) cfg.users
|
||||
));
|
||||
}) cfg.groups;
|
||||
groups = attrValues cfg.groups;
|
||||
});
|
||||
|
||||
systemShells =
|
||||
|
|
Loading…
Reference in a new issue