treewide: remove redundant parenthesis in nix code

This commit is contained in:
Martin Weinelt 2025-06-15 03:28:48 +02:00
parent 5f592b5960
commit c7497cd5f6
No known key found for this signature in database
GPG key ID: 87C1E9888F856759
5 changed files with 20 additions and 20 deletions

View file

@ -517,7 +517,7 @@ in
type = let
loginAccount = mkOptionType {
name = "Login Account";
check = (account: builtins.elem account (builtins.attrNames cfg.loginAccounts));
check = account: builtins.elem account (builtins.attrNames cfg.loginAccounts);
};
in with types; attrsOf (either loginAccount (nonEmptyListOf loginAccount));
example = {
@ -901,7 +901,7 @@ in
};
domain = mkOption {
type = types.enum (cfg.domains);
type = types.enum cfg.domains;
example = "example.com";
description = ''
The domain from which outgoing DMARC reports are served.

View file

@ -148,7 +148,7 @@ in
];
warnings =
(lib.optional (
lib.optional (
(builtins.length cfg.fullTextSearch.languages > 1) &&
(builtins.elem "stopwords" cfg.fullTextSearch.filters)
) ''
@ -158,7 +158,7 @@ in
The recommended solution is to NOT use the stopword filter when
multiple languages are present in the configuration.
'')
''
;
# for sieve-test. Shelling it in on demand usually doesnt' work, as it reads

View file

@ -75,23 +75,23 @@ let
in builtins.toFile "regex_valias" content;
# denied_recipients_postfix :: [ String ]
denied_recipients_postfix = (map
denied_recipients_postfix = map
(acct: "${acct.name} REJECT ${acct.sendOnlyRejectMessage}")
(lib.filter (acct: acct.sendOnly) (lib.attrValues cfg.loginAccounts)));
(lib.filter (acct: acct.sendOnly) (lib.attrValues cfg.loginAccounts));
denied_recipients_file = builtins.toFile "denied_recipients" (lib.concatStringsSep "\n" denied_recipients_postfix);
reject_senders_postfix = (map
reject_senders_postfix = map
(sender:
"${sender} REJECT")
(cfg.rejectSender));
reject_senders_file = builtins.toFile "reject_senders" (lib.concatStringsSep "\n" (reject_senders_postfix)) ;
cfg.rejectSender;
reject_senders_file = builtins.toFile "reject_senders" (lib.concatStringsSep "\n" reject_senders_postfix) ;
reject_recipients_postfix = (map
reject_recipients_postfix = map
(recipient:
"${recipient} REJECT")
(cfg.rejectRecipients));
cfg.rejectRecipients;
# rejectRecipients :: [ Path ]
reject_recipients_file = builtins.toFile "reject_recipients" (lib.concatStringsSep "\n" (reject_recipients_postfix)) ;
reject_recipients_file = builtins.toFile "reject_recipients" (lib.concatStringsSep "\n" reject_recipients_postfix) ;
# vhosts_file :: Path
vhosts_file = builtins.toFile "vhosts" (concatStringsSep "\n" cfg.domains);
@ -231,7 +231,7 @@ in
virtual_mailbox_domains = vhosts_file;
virtual_mailbox_maps = [
(mappedFile "valias")
] ++ lib.optionals (cfg.ldap.enable) [
] ++ lib.optionals cfg.ldap.enable [
"ldap:${ldapVirtualMailboxMapFile}"
] ++ lib.optionals (regex_valiases_postfix != {}) [
(mappedRegexFile "regex_valias")

View file

@ -171,7 +171,7 @@ in
];
};
systemd.services.rspamd-dmarc-reporter = lib.optionalAttrs (cfg.dmarcReporting.enable) {
systemd.services.rspamd-dmarc-reporter = lib.optionalAttrs cfg.dmarcReporting.enable {
# Explicitly select yesterday's date to work around broken
# default behaviour when called without a date.
# https://github.com/rspamd/rspamd/issues/4062
@ -216,7 +216,7 @@ in
};
};
systemd.timers.rspamd-dmarc-reporter = lib.optionalAttrs (cfg.dmarcReporting.enable) {
systemd.timers.rspamd-dmarc-reporter = lib.optionalAttrs cfg.dmarcReporting.enable {
description = "Daily delivery of aggregated DMARC reports";
wantedBy = [
"timers.target"

View file

@ -70,17 +70,17 @@ let
in {
config = lib.mkIf enable {
# assert that all accounts provide a password
assertions = (map (acct: {
assertion = (acct.hashedPassword != null || acct.hashedPasswordFile != null);
assertions = map (acct: {
assertion = acct.hashedPassword != null || acct.hashedPasswordFile != null;
message = "${acct.name} must provide either a hashed password or a password hash file";
}) (lib.attrValues loginAccounts));
}) (lib.attrValues loginAccounts);
# warn for accounts that specify both password and file
warnings = (map
warnings = map
(acct: "${acct.name} specifies both a password hash and hash file; hash file will be used")
(lib.filter
(acct: (acct.hashedPassword != null && acct.hashedPasswordFile != null))
(lib.attrValues loginAccounts)));
(lib.attrValues loginAccounts));
# set the vmail gid to a specific value
users.groups = {