summaryrefslogtreecommitdiffstats
path: root/default.nix
diff options
context:
space:
mode:
authorMatt Votava <mvnetbiz@gmail.com>2020-09-13 07:58:26 -0700
committerMatt Votava <mvnetbiz@gmail.com>2020-09-14 10:49:32 -0700
commit358cfcdfbe6ca137983c6629e174a98c306209cd (patch)
tree22f4e39a21e17393893aaccbb59b5375cd6b6ac2 /default.nix
parente2ed4541d49676aa1b56fc683967fd84f624ea84 (diff)
Declare default dovecot2 mailboxes as attrset for 20.09+
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix46
1 files changed, 21 insertions, 25 deletions
diff --git a/default.nix b/default.nix
index bfddc3e..6b96acd 100644
--- a/default.nix
+++ b/default.nix
@@ -307,31 +307,27 @@ in
The mailboxes for dovecot.
Depending on the mail client used it might be necessary to change some mailbox's name.
'';
- default = [
- {
- name = "Trash";
- auto = "no";
- specialUse = "Trash";
- }
-
- {
- name = "Junk";
- auto = "subscribe";
- specialUse = "Junk";
- }
-
- {
- name = "Drafts";
- auto = "subscribe";
- specialUse = "Drafts";
- }
-
- {
- name = "Sent";
- auto = "subscribe";
- specialUse = "Sent";
- }
- ];
+ default = let
+ defMailBoxes = {
+ Trash = {
+ auto = "no";
+ specialUse = "Trash";
+ };
+ Junk = {
+ auto = "subscribe";
+ specialUse = "Junk";
+ };
+ Drafts = {
+ auto = "subscribe";
+ specialUse = "Drafts";
+ };
+ Sent = {
+ auto = "subscribe";
+ specialUse = "Sent";
+ };
+ };
+ in if (versionAtLeast version "20.09pre") then defMailBoxes
+ else (flip mapAttrsToList defMailBoxes (name: options: { inherit name; } // options));
};
certificateScheme = mkOption {