From bec27fabee7ff51a4788840479b1730ed1b64427 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Sat, 10 Jun 2023 20:16:12 +0200 Subject: treewide: use lib.optional instead of 'then []' --- nixos/modules/services/security/kanidm.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos/modules/services/security') diff --git a/nixos/modules/services/security/kanidm.nix b/nixos/modules/services/security/kanidm.nix index 71ccded7dce1..cea2a56bdcd1 100644 --- a/nixos/modules/services/security/kanidm.nix +++ b/nixos/modules/services/security/kanidm.nix @@ -17,7 +17,7 @@ let # If the new path is a prefix to some existing path, we need to filter it out filteredPaths = lib.filter (p: !lib.hasPrefix (builtins.toString newPath) (builtins.toString p)) merged; # If a prefix of the new path is already in the list, do not add it - filteredNew = if hasPrefixInList filteredPaths newPath then [] else [ newPath ]; + filteredNew = lib.optional (!hasPrefixInList filteredPaths newPath) newPath; in filteredPaths ++ filteredNew) []; defaultServiceConfig = { -- cgit 1.4.1