diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-06-06 21:37:46 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-06-06 21:37:46 +0200 |
commit | fccc098fa6d5636a6dad9a393414d7a1dfbac8ec (patch) | |
tree | f6c4b0d0be00c67edcc994c2bf3dd076d3ffbdaf /pkgs/by-name/st/stalwart-mail-patched/package.nix | |
parent | hosts/server2: Enable atuin-sync (diff) | |
download | nixos-server-fccc098fa6d5636a6dad9a393414d7a1dfbac8ec.zip |
pkgs/stalwart-mail: Update to nixos 25.05
Now the stalwart-mail package is by default free. As such, we could drop the respective patches.
Diffstat (limited to 'pkgs/by-name/st/stalwart-mail-patched/package.nix')
-rw-r--r-- | pkgs/by-name/st/stalwart-mail-patched/package.nix | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/pkgs/by-name/st/stalwart-mail-patched/package.nix b/pkgs/by-name/st/stalwart-mail-patched/package.nix new file mode 100644 index 0000000..5b1c409 --- /dev/null +++ b/pkgs/by-name/st/stalwart-mail-patched/package.nix @@ -0,0 +1,61 @@ +{ + stalwart-mail, + callPackage, + nixLib, +}: let + spamfilter = callPackage ./spam-filter.nix {}; + + mail-send = callPackage ./mail-send.nix {}; +in + stalwart-mail.overrideAttrs (final: prev: { + pname = "stalwart-mail-patched"; + + passthru = nixLib.warnMerge (prev.passthru or {}) { + inherit spamfilter; + } "stalwart-mail passthru"; + + # The NixOS build tests should check if this works. + # And this shaves of around 50% of the build time. + doCheck = false; + + # We are already overriding it, so shaving of some unused features is okay. + buildNoDefaultFeatures = true; + buildFeatures = [ + # "sqlite" + # "postgres" + # "mysql" + "rocks" + # "elastic" + # "s3" + "redis" + ]; + + postUnpack = + (prev.postUnpack or "") + + '' + cp --recursive "${mail-send}" ./source/crates/mail-send + chmod --recursive +w "./source/crates/mail-send" + ''; + + cargoPatches = + (prev.cargoPatches or []) + ++ [ + # `stalwart-mail` uses their bundled store, which makes it impossible to use our + # own CA certificate (e.g., for tests). Thus use a native version. + ./patches/crates-Use-the-platform-CA-bundle-instead-of-the-bun.patch + ]; + + # Check that the enterprise feature is really disabled. + postCheck = + (prev.postCheck or "") + + + # bash + '' + if grep "enterprise" ./target/*/release/stalwart-mail.d; then + echo "ERROR: Proprietary 'enterprise' feature active." + exit 1 + fi + ''; + + meta.mainProgram = prev.meta.mainProgram or "stalwart-mail"; + }) |