maddy: include systemd units

This commit is contained in:
Aaron Andersen 2021-09-11 09:12:19 -04:00
parent 1b137b1595
commit eb2457fe26

View file

@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub }:
{ lib, buildGoModule, fetchFromGitHub, coreutils }:
buildGoModule rec {
pname = "maddy";
@ -17,6 +17,18 @@ buildGoModule rec {
subPackages = [ "cmd/maddy" "cmd/maddyctl" ];
postInstall = ''
mkdir -p $out/lib/systemd/system
substitute dist/systemd/maddy.service $out/lib/systemd/system/maddy.service \
--replace "/usr/bin/maddy" "$out/bin/maddy" \
--replace "/bin/kill" "${coreutils}/bin/kill"
substitute dist/systemd/maddy@.service $out/lib/systemd/system/maddy@.service \
--replace "/usr/bin/maddy" "$out/bin/maddy" \
--replace "/bin/kill" "${coreutils}/bin/kill"
'';
meta = with lib; {
description = "Composable all-in-one mail server";
homepage = "https://foxcpp.dev/maddy";