stalwart-mail: package upstream systemd unit

This commit is contained in:
Jonas Heinrich
2024-05-31 10:22:15 +02:00
parent dfa130e828
commit 336232debd
2 changed files with 9 additions and 0 deletions
@@ -81,11 +81,13 @@ in {
services.stalwart-mail = {
wantedBy = [ "multi-user.target" ];
after = [ "local-fs.target" "network.target" ];
preStart = if useLegacyStorage then ''
mkdir -p ${dataDir}/{queue,reports,data/blobs}
'' else ''
mkdir -p ${dataDir}/{queue,reports,db}
'';
serviceConfig = {
ExecStart = [
""
@@ -62,6 +62,13 @@ rustPlatform.buildRustPackage {
ROCKSDB_LIB_DIR = "${rocksdb}/lib";
};
postInstall = ''
mkdir -p $out/lib/systemd/system
substitute resources/systemd/stalwart-mail.service $out/lib/systemd/system/stalwart-mail.service \
--replace "__PATH__" "$out"
'';
# Tests require reading to /etc/resolv.conf
doCheck = false;