modules: users: simplify 'groupsIfExist'

This commit is contained in:
Bruno BELANYI 2021-05-09 12:14:50 +02:00
parent 62cee0be61
commit 996d61b0f4

View file

@ -2,11 +2,8 @@
{ config, lib, pkgs, ... }:
let
my = config.my;
groupIfExists = grp:
lib.lists.optional
(builtins.hasAttr grp config.users.groups)
grp;
groupsIfExist = builtins.concatMap groupIfExists;
groupExists = grp: builtins.hasAttr grp config.users.groups;
groupsIfExist = builtins.filter groupExists;
in
{
users.mutableUsers = false; # I want it to be declarative.