modules: users: simplify 'groupsIfExist'
This commit is contained in:
parent
f04368a71e
commit
fab93a5f2f
|
@ -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.
|
||||||
|
|
Loading…
Reference in a new issue