treewide: use optional instead of 'then []'

This commit is contained in:
Felix Buehler 2023-06-25 11:47:43 +02:00 committed by Anderson Torres
parent 175e9d1f00
commit 933a41a73f
17 changed files with 45 additions and 65 deletions

View file

@ -216,10 +216,10 @@ in
${concatStringsSep "\n" (
lists.flatten (
map (
rule: if (length rule.commands != 0) then [
rule: optionals (length rule.commands != 0) [
(map (user: "${toUserString user} ${rule.host}=(${rule.runAs}) ${toCommandsString rule.commands}") rule.users)
(map (group: "${toGroupString group} ${rule.host}=(${rule.runAs}) ${toCommandsString rule.commands}") rule.groups)
] else []
]
) cfg.extraRules
)
)}