about summary refs log tree commit diff
path: root/nixos/modules/services/security
diff options
context:
space:
mode:
authorFelix Buehler <account@buehler.rocks>2023-06-10 20:16:12 +0200
committerEmery Hemingway <ehmry@posteo.net>2023-07-12 09:36:28 +0100
commitbec27fabee7ff51a4788840479b1730ed1b64427 (patch)
tree638353517b8f8eb3b5b8d4fbc7172cd1aa42d47d /nixos/modules/services/security
parentb63179691fb19cd8bb63fbb005bb3120a36deba0 (diff)
downloadnixlib-bec27fabee7ff51a4788840479b1730ed1b64427.tar
nixlib-bec27fabee7ff51a4788840479b1730ed1b64427.tar.gz
nixlib-bec27fabee7ff51a4788840479b1730ed1b64427.tar.bz2
nixlib-bec27fabee7ff51a4788840479b1730ed1b64427.tar.lz
nixlib-bec27fabee7ff51a4788840479b1730ed1b64427.tar.xz
nixlib-bec27fabee7ff51a4788840479b1730ed1b64427.tar.zst
nixlib-bec27fabee7ff51a4788840479b1730ed1b64427.zip
treewide: use lib.optional instead of 'then []'
Diffstat (limited to 'nixos/modules/services/security')
-rw-r--r--nixos/modules/services/security/kanidm.nix2
1 files changed, 1 insertions, 1 deletions
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 = {