From fab93a5f2fec32f87c2ed0c759775a2d9205f8cc Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 9 May 2021 12:14:50 +0200 Subject: [PATCH] modules: users: simplify 'groupsIfExist' --- modules/users.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/users.nix b/modules/users.nix index 3bc1c37..15896e0 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -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.