1
0
Fork 1
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:
Silvan Mosberger 2021-08-25 20:17:09 +02:00 committed by GitHub
commit 1ad73dadd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 =