3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/servers/maddy/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.4 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitHub, coreutils, installShellFiles, scdoc, nixosTests }:
2021-02-05 10:14:31 +00:00
buildGoModule rec {
pname = "maddy";
2022-02-18 16:19:24 +00:00
version = "0.5.3";
2021-02-05 10:14:31 +00:00
src = fetchFromGitHub {
owner = "foxcpp";
repo = "maddy";
rev = "v${version}";
2022-02-18 16:19:24 +00:00
sha256 = "sha256-UB9Y2nNkiN0L3NIfUqnpaJJqNuAnCYIeEyS60TnnIRs=";
2021-02-05 10:14:31 +00:00
};
2022-02-18 16:19:24 +00:00
vendorSha256 = "sha256-lL9hlICc9t/2v6eawG8LU6hpAKpY7raTg5l1RagewPs=";
2021-02-05 10:14:31 +00:00
2021-08-26 07:45:51 +01:00
ldflags = [ "-s" "-w" "-X github.com/foxcpp/maddy.Version=${version}" ];
2021-02-05 10:14:31 +00:00
subPackages = [ "cmd/maddy" "cmd/maddyctl" ];
2021-10-12 09:00:56 +01:00
nativeBuildInputs = [ installShellFiles scdoc ];
2021-09-11 14:12:19 +01:00
postInstall = ''
2021-10-12 09:00:56 +01:00
for f in docs/man/*.scd; do
local page="docs/man/$(basename "$f" .scd)"
scdoc < "$f" > "$page"
installManPage "$page"
done
2021-09-11 14:12:19 +01:00
mkdir -p $out/lib/systemd/system
substitute dist/systemd/maddy.service $out/lib/systemd/system/maddy.service \
--replace "/usr/local/bin/maddy" "$out/bin/maddy" \
2021-09-11 14:12:19 +01:00
--replace "/bin/kill" "${coreutils}/bin/kill"
substitute dist/systemd/maddy@.service $out/lib/systemd/system/maddy@.service \
--replace "/usr/local/bin/maddy" "$out/bin/maddy" \
2021-09-11 14:12:19 +01:00
--replace "/bin/kill" "${coreutils}/bin/kill"
'';
passthru.tests.nixos = nixosTests.maddy;
2021-02-05 10:14:31 +00:00
meta = with lib; {
description = "Composable all-in-one mail server";
homepage = "https://maddy.email";
2021-02-05 10:14:31 +00:00
license = licenses.gpl3Plus;
2021-10-12 09:00:56 +01:00
maintainers = with maintainers; [ nickcao ];
2021-02-05 10:14:31 +00:00
};
}