dmarc-report-converter: refactor the package.nix (#351666)

This commit is contained in:
Weijia Wang 2024-11-23 15:28:59 +01:00 committed by GitHub
commit 04223e4113
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,8 +1,9 @@
{ lib
, buildGoModule
, dmarc-report-converter
, fetchFromGitHub
, runCommand
{
lib,
buildGoModule,
dmarc-report-converter,
fetchFromGitHub,
testers,
}:
buildGoModule rec {
@ -18,23 +19,21 @@ buildGoModule rec {
vendorHash = null;
checkFlags = [ "-mod=vendor ./cmd/... ./pkg/..." ];
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
];
passthru.tests = {
simple = runCommand "dmarc-report-converter-test" { } ''
${dmarc-report-converter}/bin/dmarc-report-converter -h > $out
'';
};
passthru.tests.version = testers.testVersion { package = dmarc-report-converter; };
meta = with lib; {
meta = {
description = "Convert DMARC report files from xml to human-readable formats";
homepage = "https://github.com/tierpod/dmarc-report-converter";
license = licenses.mit;
maintainers = with maintainers; [ Nebucatnetzer ];
license = lib.licenses.mit;
maintainers = [ lib.maintainers.Nebucatnetzer ];
mainProgram = "dmarc-report-converter";
};
}