From 233c5e1a70be1b6cd01f88a2755459d32b66ab38 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 29 May 2025 14:06:34 +0200 Subject: [PATCH] dovecot: remove workaround for services.dovecot2.modules removal --- mail-server/dovecot.nix | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/mail-server/dovecot.nix b/mail-server/dovecot.nix index 56cebf2..894b02e 100644 --- a/mail-server/dovecot.nix +++ b/mail-server/dovecot.nix @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see -{ options, config, pkgs, lib, ... }: +{ config, pkgs, lib, ... }: with (import ./common.nix { inherit config pkgs lib; }); @@ -125,12 +125,6 @@ let else scope ); - dovecotModules = [ - pkgs.dovecot_pigeonhole - ] ++ lib.optional cfg.fullTextSearch.enable pkgs.dovecot-fts-flatcurve; - # Remove and assume `false` after NixOS 25.05 - haveDovecotModulesOption = options.services.dovecot2 ? "modules" && (options.services.dovecot2.modules.visible or true); - ftsPluginSettings = { fts = "flatcurve"; fts_languages = listToLine cfg.fullTextSearch.languages; @@ -172,14 +166,12 @@ in # which are usually not compatible. environment.systemPackages = [ pkgs.dovecot_pigeonhole - ] ++ lib.optionals (!haveDovecotModulesOption) dovecotModules; + ] ++ lib.optional cfg.fullTextSearch.enable pkgs.dovecot-fts-flatcurve; # For compatibility with python imaplib - environment.etc = lib.mkIf (!haveDovecotModulesOption) { - "dovecot/modules".source = "/run/current-system/sw/lib/dovecot/modules"; - }; + environment.etc."dovecot/modules".source = "/run/current-system/sw/lib/dovecot/modules"; - services.dovecot2 = lib.mkMerge [{ + services.dovecot2 = { enable = true; enableImap = enableImap || enableImapSsl; enablePop3 = enablePop3 || enablePop3Ssl; @@ -384,11 +376,7 @@ in lda_mailbox_autosubscribe = yes lda_mailbox_autocreate = yes ''; - } - (lib.mkIf haveDovecotModulesOption { - modules = dovecotModules; - }) - ]; + }; systemd.services.dovecot2 = { preStart = ''