16 src = fetchFromGitHub {
20 sha256 = "sha256-jVlIjeBvxc82GQn8vW2RqcAErxZqftGj32d+IbBxQxY=";
23 vendorHash = "sha256-bSBk68w6T/Wy5klj5oC/ZW5TqDESG3mW9cIQ3auNmCk=";
27 ldflags = [ "-s" "-w" "-X github.com/foxcpp/maddy.Version=${version}" ];
29 subPackages = [ "cmd/maddy" ];
31 buildInputs = [ pam ];
33 nativeBuildInputs = [ installShellFiles scdoc ];
36 for f in docs/man/*.scd; do
37 local page="docs/man/$(basename "$f" .scd)"
38 scdoc < "$f" > "$page"
39 installManPage "$page"
42 ln -s "$out/bin/maddy" "$out/bin/maddyctl"
44 mkdir -p $out/lib/systemd/system
46 substitute dist/systemd/maddy.service $out/lib/systemd/system/maddy.service \
47 --replace "/usr/local/bin/maddy" "$out/bin/maddy" \
48 --replace "/bin/kill" "${coreutils}/bin/kill"
50 substitute dist/systemd/maddy@.service $out/lib/systemd/system/maddy@.service \
51 --replace "/usr/local/bin/maddy" "$out/bin/maddy" \
52 --replace "/bin/kill" "${coreutils}/bin/kill"
55 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=strict-prototypes";
57 passthru.tests.nixos = nixosTests.maddy;
60 description = "Composable all-in-one mail server";
61 homepage = "https://maddy.email";
62 license = licenses.gpl3Plus;
63 maintainers = with maintainers; [ nickcao ];