modules: users: simplify 'groupsIfExist'

This commit is contained in:
Bruno BELANYI 2021-05-09 12:14:50 +02:00
parent f04368a71e
commit fab93a5f2f

View file

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