mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
Merge pull request #313634 from onny/stalwart-systemd
stalwart-mail: package und use upstream systemd unit
This commit is contained in:
commit
e45abe6d47
@ -76,7 +76,9 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.stalwart-mail = {
|
systemd = {
|
||||||
|
packages = [ cfg.package ];
|
||||||
|
services.stalwart-mail = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
after = [ "local-fs.target" "network.target" ];
|
after = [ "local-fs.target" "network.target" ];
|
||||||
|
|
||||||
@ -87,22 +89,14 @@ in {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart =
|
ExecStart = [
|
||||||
"${cfg.package}/bin/stalwart-mail --config=${configFile}";
|
""
|
||||||
|
"${cfg.package}/bin/stalwart-mail --config=${configFile}"
|
||||||
|
];
|
||||||
|
|
||||||
# Base from template resources/systemd/stalwart-mail.service
|
|
||||||
Type = "simple";
|
|
||||||
LimitNOFILE = 65536;
|
|
||||||
KillMode = "process";
|
|
||||||
KillSignal = "SIGINT";
|
|
||||||
Restart = "on-failure";
|
|
||||||
RestartSec = 5;
|
|
||||||
StandardOutput = "journal";
|
StandardOutput = "journal";
|
||||||
StandardError = "journal";
|
StandardError = "journal";
|
||||||
SyslogIdentifier = "stalwart-mail";
|
|
||||||
|
|
||||||
User = "stalwart-mail";
|
|
||||||
Group = "stalwart-mail";
|
|
||||||
StateDirectory = "stalwart-mail";
|
StateDirectory = "stalwart-mail";
|
||||||
|
|
||||||
# Bind standard privileged ports
|
# Bind standard privileged ports
|
||||||
@ -134,6 +128,11 @@ in {
|
|||||||
SystemCallFilter = [ "@system-service" "~@privileged" ];
|
SystemCallFilter = [ "@system-service" "~@privileged" ];
|
||||||
UMask = "0077";
|
UMask = "0077";
|
||||||
};
|
};
|
||||||
|
unitConfig.ConditionPathExists = [
|
||||||
|
""
|
||||||
|
"${configFile}"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Make admin commands available in the shell
|
# Make admin commands available in the shell
|
||||||
|
@ -62,6 +62,13 @@ rustPlatform.buildRustPackage {
|
|||||||
ROCKSDB_LIB_DIR = "${rocksdb}/lib";
|
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
|
# Tests require reading to /etc/resolv.conf
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user