2021-10-14 00:43:12 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, coreutils, installShellFiles, scdoc }:
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "maddy";
|
2021-10-14 00:43:12 +00:00
|
|
|
version = "0.5.2";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "foxcpp";
|
|
|
|
repo = "maddy";
|
|
|
|
rev = "v${version}";
|
2021-10-14 00:43:12 +00:00
|
|
|
sha256 = "sha256-b85g8Eu7qWTI+ggMr7JL/2BAVbkXocpsR89P6s6TfMg=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
2021-10-14 00:43:12 +00:00
|
|
|
vendorSha256 = "sha256-kzSwqT3r6uGxq1GNzCWCn8VoCxmVtiUb23XLCpsPv/c=";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
ldflags = [ "-s" "-w" "-X github.com/foxcpp/maddy.Version=${version}" ];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
subPackages = [ "cmd/maddy" "cmd/maddyctl" ];
|
|
|
|
|
2021-10-14 00:43:12 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles scdoc ];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
postInstall = ''
|
2021-10-14 00:43:12 +00:00
|
|
|
for f in docs/man/*.scd; do
|
|
|
|
local page="docs/man/$(basename "$f" .scd)"
|
|
|
|
scdoc < "$f" > "$page"
|
|
|
|
installManPage "$page"
|
|
|
|
done
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
mkdir -p $out/lib/systemd/system
|
|
|
|
|
|
|
|
substitute dist/systemd/maddy.service $out/lib/systemd/system/maddy.service \
|
2021-10-17 02:12:59 +00:00
|
|
|
--replace "/usr/local/bin/maddy" "$out/bin/maddy" \
|
2021-09-18 10:52:07 +00:00
|
|
|
--replace "/bin/kill" "${coreutils}/bin/kill"
|
|
|
|
|
|
|
|
substitute dist/systemd/maddy@.service $out/lib/systemd/system/maddy@.service \
|
2021-10-17 02:12:59 +00:00
|
|
|
--replace "/usr/local/bin/maddy" "$out/bin/maddy" \
|
2021-09-18 10:52:07 +00:00
|
|
|
--replace "/bin/kill" "${coreutils}/bin/kill"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Composable all-in-one mail server";
|
2021-09-22 15:38:15 +00:00
|
|
|
homepage = "https://maddy.email";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2021-10-14 00:43:12 +00:00
|
|
|
maintainers = with maintainers; [ nickcao ];
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
}
|