nixos/stalwart-mail: package and configure webadmin

This commit is contained in:
Jonas Heinrich 2024-05-26 12:28:29 +02:00
parent 51704cb008
commit 880bd89c4d
2 changed files with 9 additions and 1 deletions

View file

@ -73,8 +73,14 @@ in {
resolver.public-suffix = lib.mkDefault [
"file://${pkgs.publicsuffix-list}/share/publicsuffix/public_suffix_list.dat"
];
config.resource = {
config.resource = let
hasHttpListener = builtins.any (listener: listener.protocol == "http") (lib.attrValues cfg.settings.server.listener);
in {
spam-filter = lib.mkDefault "file://${cfg.package}/etc/stalwart/spamfilter.toml";
} // lib.optionalAttrs (
(builtins.hasAttr "listener" cfg.settings.server) && hasHttpListener
) {
webadmin = lib.mkDefault "file://${cfg.package.webadmin}/webadmin.zip";
};
};

View file

@ -15,6 +15,7 @@
nix-update-script,
nixosTests,
rocksdb_8_11,
callPackage,
}:
let
@ -144,6 +145,7 @@ rustPlatform.buildRustPackage {
doCheck = !(stdenv.isLinux && stdenv.isAarch64);
passthru = {
webadmin = callPackage ./webadmin.nix { };
update-script = nix-update-script { };
tests.stalwart-mail = nixosTests.stalwart-mail;
};