From 64ad2a6356ea9c8c41eea092a215b4c9d3cf3440 Mon Sep 17 00:00:00 2001 From: "@norpol" <2230917+norpol@users.noreply.github.com> Date: Mon, 7 Jul 2025 22:30:15 +0100 Subject: [PATCH 1/3] maintainers: add norpol --- maintainers/maintainer-list.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 3259e4ac12b0..aec321508939 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -18284,6 +18284,13 @@ ]; matrix = "@normalcea:matrix.org"; }; + norpol = { + name = "Syd Lightyear"; + email = "norpol+nixpkgs@exaple.org"; + matrix = "@phileas:asra.gr"; + github = "norpol"; + githubId = 98636020; + }; nosewings = { name = "Nicholas Coltharp"; email = "coltharpnicholas@gmail.com"; From 7177cb15172425a3591f6181468a122015331e0e Mon Sep 17 00:00:00 2001 From: "@norpol" <2230917+norpol@users.noreply.github.com> Date: Sun, 6 Jul 2025 11:29:57 +0100 Subject: [PATCH 2/3] stalwart-mail: Fix spam-filter missing from `/etc` --- nixos/modules/services/mail/stalwart-mail.nix | 3 +- pkgs/by-name/st/stalwart-mail/package.nix | 2 + pkgs/by-name/st/stalwart-mail/spam-filter.nix | 43 +++++++++++++++++++ pkgs/by-name/st/stalwart-mail/webadmin.nix | 3 +- pkgs/top-level/all-packages.nix | 1 + 5 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 pkgs/by-name/st/stalwart-mail/spam-filter.nix diff --git a/nixos/modules/services/mail/stalwart-mail.nix b/nixos/modules/services/mail/stalwart-mail.nix index e053bd9400c4..9975bcc56672 100644 --- a/nixos/modules/services/mail/stalwart-mail.nix +++ b/nixos/modules/services/mail/stalwart-mail.nix @@ -107,7 +107,7 @@ in resolver.public-suffix = lib.mkDefault [ "file://${pkgs.publicsuffix-list}/share/publicsuffix/public_suffix_list.dat" ]; - spam-filter.resource = lib.mkDefault "file://${cfg.package}/etc/stalwart/spamfilter.toml"; + spam-filter.resource = lib.mkDefault "file://${cfg.package.spam-filter}/spam-filter.toml"; webadmin = let hasHttpListener = builtins.any (listener: listener.protocol == "http") ( @@ -232,6 +232,7 @@ in happysalada euxane onny + norpol ]; }; } diff --git a/pkgs/by-name/st/stalwart-mail/package.nix b/pkgs/by-name/st/stalwart-mail/package.nix index 472a7824561a..8af1fadd963a 100644 --- a/pkgs/by-name/st/stalwart-mail/package.nix +++ b/pkgs/by-name/st/stalwart-mail/package.nix @@ -162,6 +162,7 @@ rustPlatform.buildRustPackage (finalAttrs: { passthru = { inherit rocksdb; # make used rocksdb version available (e.g., for backup scripts) webadmin = callPackage ./webadmin.nix { }; + spam-filter = callPackage ./spam-filter.nix { }; updateScript = nix-update-script { }; tests.stalwart-mail = nixosTests.stalwart-mail; }; @@ -187,6 +188,7 @@ rustPlatform.buildRustPackage (finalAttrs: { onny oddlama pandapip1 + norpol ]; }; }) diff --git a/pkgs/by-name/st/stalwart-mail/spam-filter.nix b/pkgs/by-name/st/stalwart-mail/spam-filter.nix new file mode 100644 index 000000000000..d0ca6c60b5af --- /dev/null +++ b/pkgs/by-name/st/stalwart-mail/spam-filter.nix @@ -0,0 +1,43 @@ +{ + lib, + fetchFromGitHub, + stdenv, + stalwart-mail, + nix-update-script, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "spam-filter"; + version = "2.0.3"; + + src = fetchFromGitHub { + owner = "stalwartlabs"; + repo = "spam-filter"; + tag = "v${finalAttrs.version}"; + hash = "sha256-NhD/qUiGhgESwR2IOzAHfDATRlgWMcCktlktvVfDONk="; + }; + + buildPhase = '' + bash ./build.sh + ''; + + installPhase = '' + mkdir -p $out + cp spam-filter.toml $out/ + ''; + + passthru = { + updateScript = nix-update-script { }; + }; + + meta = { + description = "Secure & modern all-in-one mail server Stalwart (spam-filter module)"; + homepage = "https://github.com/stalwartlabs/spam-filter"; + changelog = "https://github.com/stalwartlabs/spam-filter/blob/${finalAttrs.src.tag}/CHANGELOG.md"; + license = with lib.licenses; [ + mit + asl20 + ]; + inherit (stalwart-mail.meta) maintainers; + }; +}) diff --git a/pkgs/by-name/st/stalwart-mail/webadmin.nix b/pkgs/by-name/st/stalwart-mail/webadmin.nix index 0d9021ee083f..1b2443e94e35 100644 --- a/pkgs/by-name/st/stalwart-mail/webadmin.nix +++ b/pkgs/by-name/st/stalwart-mail/webadmin.nix @@ -1,6 +1,7 @@ { lib, rustPlatform, + stalwart-mail, fetchFromGitHub, trunk, tailwindcss_3, @@ -73,6 +74,6 @@ rustPlatform.buildRustPackage rec { homepage = "https://github.com/stalwartlabs/webadmin"; changelog = "https://github.com/stalwartlabs/webadmin/blob/${src.tag}/CHANGELOG.md"; license = lib.licenses.agpl3Only; - maintainers = with lib.maintainers; [ onny ]; + inherit (stalwart-mail.meta) maintainers; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 367d22a2779a..6565ae68fbdc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10765,6 +10765,7 @@ with pkgs; }; stalwart-mail-webadmin = stalwart-mail.webadmin; + stalwart-mail-spam-filter = stalwart-mail.spam-filter; stalwart-mail-enterprise = stalwart-mail.override { stalwartEnterprise = true; From c8bd8fc51f6d1023702cdb672fbd705a4571d2ce Mon Sep 17 00:00:00 2001 From: "@norpol" <2230917+norpol@users.noreply.github.com> Date: Mon, 7 Jul 2025 22:00:37 +0100 Subject: [PATCH 3/3] stalwart-mail: webmail, ensure overridable recursive attributes Follows https://github.com/NixOS/nixpkgs/pull/119942 --- pkgs/by-name/st/stalwart-mail/webadmin.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/st/stalwart-mail/webadmin.nix b/pkgs/by-name/st/stalwart-mail/webadmin.nix index 1b2443e94e35..ccb57af94675 100644 --- a/pkgs/by-name/st/stalwart-mail/webadmin.nix +++ b/pkgs/by-name/st/stalwart-mail/webadmin.nix @@ -15,20 +15,19 @@ zip, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "webadmin"; version = "0.1.28"; src = fetchFromGitHub { owner = "stalwartlabs"; repo = "webadmin"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-OgZ2qs84zVM2zNmBQSPnb9Uy4mahzNC81vbWM9wmrn4="; }; npmDeps = fetchNpmDeps { - inherit src; - name = "${pname}-npm-deps"; + name = "${finalAttrs.pname}-npm-deps"; hash = "sha256-na1HEueX8w7kuDp8LEtJ0nD1Yv39cyk6sEMpS1zix2s="; }; @@ -72,8 +71,8 @@ rustPlatform.buildRustPackage rec { meta = { description = "Secure & modern all-in-one mail server Stalwart (webadmin module)"; homepage = "https://github.com/stalwartlabs/webadmin"; - changelog = "https://github.com/stalwartlabs/webadmin/blob/${src.tag}/CHANGELOG.md"; + changelog = "https://github.com/stalwartlabs/webadmin/blob/${finalAttrs.src.tag}/CHANGELOG.md"; license = lib.licenses.agpl3Only; inherit (stalwart-mail.meta) maintainers; }; -} +})