nixos/dovecot: add settings option (RFC42), redux (#500271)

This commit is contained in:
Martin Weinelt
2026-04-12 19:30:13 +00:00
committed by GitHub
13 changed files with 838 additions and 451 deletions
+2
View File
@@ -247,6 +247,8 @@
- All Xfce packages have been moved to top level (e.g. if you previously added `pkgs.xfce.xfce4-whiskermenu-plugin` to `environment.systemPackages`, you will need to change it to `pkgs.xfce4-whiskermenu-plugin`). The `xfce` scope will be removed in NixOS 26.11.
- The Dovecot IMAP server has been updated to version 2.4, with the `dovecot` attribute now referring to this backwards-incompatible version. The attribute `dovecot_2_3` refers to the previous version. The Pigeonhole plugin has been similarly updated to 2.4, with the version compatible with Dovecot 2.3 being at `dovecot_pigeonhole_0_5`. See <https://doc.dovecot.org/latest/installation/upgrade/2.3-to-2.4.html> for more information on how to upgrade.
- `spacefm` was removed because it appeared to be unmaintained upstream.
- `vimPlugins.nvim-treesitter` has been updated to `main` branch, which is a full and incompatible rewrite. If you can't or don't want to update, you should use `vimPlugins.nvim-treesitter-legacy`.
@@ -325,6 +325,10 @@ See <https://github.com/NixOS/nixpkgs/issues/481673>.
- For shortlived certificates with a total validty below 10 days renewal
will happen after half of the total lifetime has passed
- The module for the Dovecot IMAP server, *services.dovecot*, now uses RFC-42-style settings, exposing a structured interface to write the configuration file.
Also see the list of available settings for [Dovecot 2.3](https://doc.dovecot.org/2.3/settings/core/) or [2.4](https://doc.dovecot.org/2.4.2/core/summaries/settings.html).
- Cinnamon has been updated to 6.6, please check the [upstream announcement](https://www.linuxmint.com/rel_zena_whatsnew.php) for more details.
- Budgie has been updated to 10.10, please check the [upstream announcement](https://buddiesofbudgie.org/blog/budgie-10-10-released) for more details.
File diff suppressed because it is too large Load Diff
+19 -9
View File
@@ -2,18 +2,28 @@
name = "dovecot";
nodes.machine =
{ pkgs, ... }:
{ config, pkgs, ... }:
let
dovecot = config.services.dovecot2.package;
in
{
imports = [ common/user-account.nix ];
services.postfix.enable = true;
services.dovecot2 = {
enable = true;
protocols = [
"imap"
"pop3"
];
mailUser = "vmail";
mailGroup = "vmail";
enablePAM = true;
settings = {
dovecot_config_version = dovecot.version;
dovecot_storage_version = dovecot.version;
mail_driver = "maildir";
mail_path = "${config.services.postfix.settings.main.mail_spool_directory}/%{user}";
protocols = [
"imap"
"pop3"
];
mail_uid = "vmail";
mail_gid = "vmail";
};
};
environment.systemPackages =
let
@@ -31,7 +41,7 @@
sendTestMailViaDeliveryAgent = pkgs.writeScriptBin "send-lda" ''
#!${pkgs.runtimeShell}
exec ${pkgs.dovecot}/libexec/dovecot/deliver -d bob <<MAIL
exec ${dovecot}/libexec/dovecot/deliver -d bob <<MAIL
From: root@localhost
To: bob@localhost
Subject: Something else...
@@ -74,7 +84,7 @@
in
[
pkgs.dovecot_pigeonhole
dovecot.passthru.dovecot_pigeonhole
sendTestMail
sendTestMailViaDeliveryAgent
testImap
+18
View File
@@ -0,0 +1,18 @@
import ./generic.nix {
version = "2.3.21.1";
hash = "sha256-1THBB401r6AnZbnHGhIq+o+nR8v94O0mIX68Pv0miiE=";
patches = fetchpatch: [
# Fix loading extended modules.
./load-extended-modules.patch
# fix openssl 3.0 compatibility
(fetchpatch {
url = "https://salsa.debian.org/debian/dovecot/-/raw/debian/1%252.3.19.1+dfsg1-2/debian/patches/Support-openssl-3.0.patch";
hash = "sha256-PbBB1jIY3jIC8Js1NY93zkV0gISGUq7Nc67Ul5tN7sw=";
})
(fetchpatch {
name = "dovecot-test-data-stack-drop-bogus-assertion.patch";
url = "https://github.com/dovecot/core/commit/9f642dd868db6e7401f24e4fb4031b5bdca8aae7.patch";
hash = "sha256-dAX80dRqOba9Fkzl11ChYJ6vqcgfkaw/o+TOQKCnnns=";
})
];
}
-8
View File
@@ -1,8 +0,0 @@
import ./generic.nix {
version = "2.4.3";
hash = "sha256-NTtQMHK/IzAYHKb1lxClUUJkyJpeLo7mKRCAR1GaUTo=";
patches = _: [
# Fix loading extended modules.
./load-extended-modules.patch
];
}
+1 -2
View File
@@ -33,8 +33,7 @@
fetchpatch,
rpcsvc-proto,
libtirpc,
dovecot_pigeonhole_0_5,
dovecot_pigeonhole ? dovecot_pigeonhole_0_5,
dovecot_pigeonhole,
withApparmor ? false,
libapparmor,
withLDAP ? true,
+3 -13
View File
@@ -1,18 +1,8 @@
import ./generic.nix {
version = "2.3.21.1";
hash = "sha256-1THBB401r6AnZbnHGhIq+o+nR8v94O0mIX68Pv0miiE=";
patches = fetchpatch: [
version = "2.4.3";
hash = "sha256-NTtQMHK/IzAYHKb1lxClUUJkyJpeLo7mKRCAR1GaUTo=";
patches = _: [
# Fix loading extended modules.
./load-extended-modules.patch
# fix openssl 3.0 compatibility
(fetchpatch {
url = "https://salsa.debian.org/debian/dovecot/-/raw/debian/1%252.3.19.1+dfsg1-2/debian/patches/Support-openssl-3.0.patch";
hash = "sha256-PbBB1jIY3jIC8Js1NY93zkV0gISGUq7Nc67Ul5tN7sw=";
})
(fetchpatch {
name = "dovecot-test-data-stack-drop-bogus-assertion.patch";
url = "https://github.com/dovecot/core/commit/9f642dd868db6e7401f24e4fb4031b5bdca8aae7.patch";
hash = "sha256-dAX80dRqOba9Fkzl11ChYJ6vqcgfkaw/o+TOQKCnnns=";
})
];
}
@@ -0,0 +1,10 @@
import ./generic.nix {
version = "0.5.21.1";
url =
{
version,
dovecotMajorMinor,
}:
"https://pigeonhole.dovecot.org/releases/${dovecotMajorMinor}/dovecot-${dovecotMajorMinor}-pigeonhole-${version}.tar.gz";
hash = "sha256-andOWZmgWYIPATEk0V+mHmReL+quG81azwPkBMoo9OE=";
}
@@ -1,17 +0,0 @@
import ./generic.nix {
version = "2.4.3";
url =
{
version,
dovecotMajorMinor,
}:
"https://pigeonhole.dovecot.org/releases/${dovecotMajorMinor}/dovecot-pigeonhole-${version}.tar.gz";
hash = "sha256-LQNhqYnBVICabluj8F07UOZR5frt6bd9JSyuHJDS6hc=";
patches = fetchpatch: [
# https://github.com/NixOS/nixpkgs/pull/388463#issuecomment-3066016707
(fetchpatch {
url = "https://github.com/dovecot/pigeonhole/commit/517d74aa1d98b853b72608ce722bc58009c0f4a9.patch";
hash = "sha256-BLBz9ZhOGEIIitnXG0uM6bZBRNnQBy4K2IJlh1+Un50=";
})
];
}
@@ -9,8 +9,7 @@
stdenv,
fetchpatch,
fetchzip,
dovecot_2_3,
dovecot ? dovecot_2_3,
dovecot,
openssl,
libstemmer,
perl,
+10 -3
View File
@@ -1,10 +1,17 @@
import ./generic.nix {
version = "0.5.21.1";
version = "2.4.3";
url =
{
version,
dovecotMajorMinor,
}:
"https://pigeonhole.dovecot.org/releases/${dovecotMajorMinor}/dovecot-${dovecotMajorMinor}-pigeonhole-${version}.tar.gz";
hash = "sha256-andOWZmgWYIPATEk0V+mHmReL+quG81azwPkBMoo9OE=";
"https://pigeonhole.dovecot.org/releases/${dovecotMajorMinor}/dovecot-pigeonhole-${version}.tar.gz";
hash = "sha256-LQNhqYnBVICabluj8F07UOZR5frt6bd9JSyuHJDS6hc=";
patches = fetchpatch: [
# https://github.com/NixOS/nixpkgs/pull/388463#issuecomment-3066016707
(fetchpatch {
url = "https://github.com/dovecot/pigeonhole/commit/517d74aa1d98b853b72608ce722bc58009c0f4a9.patch";
hash = "sha256-BLBz9ZhOGEIIitnXG0uM6bZBRNnQBy4K2IJlh1+Un50=";
})
];
}
+6 -6
View File
@@ -8036,15 +8036,15 @@ with pkgs;
dodgy = with python3Packages; toPythonApplication dodgy;
dovecot_2_3 = dovecot;
dovecot_2_4 = callPackage ../by-name/do/dovecot/2.4.nix {
dovecot_pigeonhole = dovecot_pigeonhole_2_4;
dovecot_2_3 = callPackage ../by-name/do/dovecot/2.3.nix {
dovecot_pigeonhole = dovecot_pigeonhole_0_5;
};
dovecot_2_4 = dovecot;
dovecot_pigeonhole_0_5 = dovecot_pigeonhole;
dovecot_pigeonhole_2_4 = callPackage ../by-name/do/dovecot_pigeonhole/2.4.nix {
dovecot = dovecot_2_4;
dovecot_pigeonhole_0_5 = callPackage ../by-name/do/dovecot_pigeonhole/0.5.nix {
dovecot = dovecot_2_3;
};
dovecot_pigeonhole_2_4 = dovecot_pigeonhole;
inherit (callPackages ../servers/firebird { })
firebird_4