mirror of
https://gitlab.com/simple-nixos-mailserver/nixos-mailserver.git
synced 2025-06-06 18:37:57 +05:00
dovecot: remove workaround for services.dovecot2.modules removal
This commit is contained in:
parent
506c6151d6
commit
233c5e1a70
@ -14,7 +14,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
|
||||||
{ options, config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
with (import ./common.nix { inherit config pkgs lib; });
|
with (import ./common.nix { inherit config pkgs lib; });
|
||||||
|
|
||||||
@ -125,12 +125,6 @@ let
|
|||||||
else scope
|
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 = {
|
ftsPluginSettings = {
|
||||||
fts = "flatcurve";
|
fts = "flatcurve";
|
||||||
fts_languages = listToLine cfg.fullTextSearch.languages;
|
fts_languages = listToLine cfg.fullTextSearch.languages;
|
||||||
@ -172,14 +166,12 @@ in
|
|||||||
# which are usually not compatible.
|
# which are usually not compatible.
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.dovecot_pigeonhole
|
pkgs.dovecot_pigeonhole
|
||||||
] ++ lib.optionals (!haveDovecotModulesOption) dovecotModules;
|
] ++ lib.optional cfg.fullTextSearch.enable pkgs.dovecot-fts-flatcurve;
|
||||||
|
|
||||||
# For compatibility with python imaplib
|
# For compatibility with python imaplib
|
||||||
environment.etc = lib.mkIf (!haveDovecotModulesOption) {
|
environment.etc."dovecot/modules".source = "/run/current-system/sw/lib/dovecot/modules";
|
||||||
"dovecot/modules".source = "/run/current-system/sw/lib/dovecot/modules";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.dovecot2 = lib.mkMerge [{
|
services.dovecot2 = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableImap = enableImap || enableImapSsl;
|
enableImap = enableImap || enableImapSsl;
|
||||||
enablePop3 = enablePop3 || enablePop3Ssl;
|
enablePop3 = enablePop3 || enablePop3Ssl;
|
||||||
@ -384,11 +376,7 @@ in
|
|||||||
lda_mailbox_autosubscribe = yes
|
lda_mailbox_autosubscribe = yes
|
||||||
lda_mailbox_autocreate = yes
|
lda_mailbox_autocreate = yes
|
||||||
'';
|
'';
|
||||||
}
|
};
|
||||||
(lib.mkIf haveDovecotModulesOption {
|
|
||||||
modules = dovecotModules;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
systemd.services.dovecot2 = {
|
systemd.services.dovecot2 = {
|
||||||
preStart = ''
|
preStart = ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user