2021-09-11 15:12:19 +02:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, coreutils }:
|
2021-02-05 11:14:31 +01:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "maddy";
|
2021-08-14 16:52:07 +02:00
|
|
|
version = "0.5.0";
|
2021-02-05 11:14:31 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "foxcpp";
|
|
|
|
repo = "maddy";
|
|
|
|
rev = "v${version}";
|
2021-08-14 16:52:07 +02:00
|
|
|
sha256 = "sha256-SxJfuNZBtwaILF4zD4hrTANc/GlOG53XVwg3NvKYAkg=";
|
2021-02-05 11:14:31 +01:00
|
|
|
};
|
|
|
|
|
2021-08-14 16:52:07 +02:00
|
|
|
vendorSha256 = "sha256-bxKEQaOubjRfLX+dMxVDzLOUInHykUdy9X8wvFE6Va4=";
|
2021-02-05 11:14:31 +01:00
|
|
|
|
2021-08-26 08:45:51 +02:00
|
|
|
ldflags = [ "-s" "-w" "-X github.com/foxcpp/maddy.Version=${version}" ];
|
2021-02-05 11:14:31 +01:00
|
|
|
|
|
|
|
subPackages = [ "cmd/maddy" "cmd/maddyctl" ];
|
|
|
|
|
2021-09-11 15:12:19 +02:00
|
|
|
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"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 11:14:31 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Composable all-in-one mail server";
|
2021-09-19 12:02:04 +02:00
|
|
|
homepage = "https://maddy.email";
|
2021-02-05 11:14:31 +01:00
|
|
|
license = licenses.gpl3Plus;
|
2021-09-19 12:02:04 +02:00
|
|
|
maintainers = with maintainers; [];
|
2021-02-05 11:14:31 +01:00
|
|
|
};
|
|
|
|
}
|