Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
50 lines
1.1 KiB
Nix
50 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
makeWrapper,
|
|
nixosTests,
|
|
systemd,
|
|
withSystemdSupport ? true,
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "postfix_exporter";
|
|
version = "0.15.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Hsn723";
|
|
repo = "postfix_exporter";
|
|
tag = "v${version}";
|
|
sha256 = "sha256-0HgvkKdgfKcX74dJLOxSnp1xJuaOazusgDrCdhX/Lg4=";
|
|
};
|
|
|
|
vendorHash = "sha256-HsXVZ6fmaGU93CpA+t/VpIsEigkh09Uw8h7eSeaThk4=";
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
];
|
|
|
|
nativeBuildInputs = lib.optionals withSystemdSupport [ makeWrapper ];
|
|
buildInputs = lib.optionals withSystemdSupport [ systemd ];
|
|
tags = lib.optionals (!withSystemdSupport) "nosystemd";
|
|
|
|
postInstall = lib.optionals withSystemdSupport ''
|
|
wrapProgram $out/bin/postfix_exporter \
|
|
--prefix LD_LIBRARY_PATH : "${lib.getLib systemd}/lib"
|
|
'';
|
|
|
|
passthru.tests = { inherit (nixosTests.prometheus-exporters) postfix; };
|
|
|
|
meta = with lib; {
|
|
inherit (src.meta) homepage;
|
|
description = "Prometheus exporter for Postfix";
|
|
mainProgram = "postfix_exporter";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [
|
|
globin
|
|
];
|
|
};
|
|
}
|