nixpkgs/pkgs/applications/networking/dnscontrol/default.nix
emilylange a1ca1b10ab
dnscontrol: add version test to passthru.tests
dnscontrol's version reporting had to be fixed twice since its addition
to nixpkgs.

This simple version test based on `testers.testVersion` should be able
to prevent it from going unnoticed again.
2024-03-05 01:58:28 +01:00

41 lines
1.0 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, testers, dnscontrol }:
buildGoModule rec {
pname = "dnscontrol";
version = "4.8.2";
src = fetchFromGitHub {
owner = "StackExchange";
repo = "dnscontrol";
rev = "v${version}";
hash = "sha256-9myo073/yl9CWwmVb3Gkihf6I/60kSOl0Pk8+dE39KM=";
};
vendorHash = "sha256-jOLFqCeBxQLXgUAdDbk/QnPBAtMBQi5VR+oKjgZLb28=";
subPackages = [ "." ];
ldflags = [ "-s" "-w" "-X=main.version=${version}" ];
preCheck = ''
# requires network
rm pkg/spflib/flatten_test.go pkg/spflib/parse_test.go
'';
passthru.tests = {
version = testers.testVersion {
command = "${lib.getExe dnscontrol} version";
package = dnscontrol;
};
};
meta = with lib; {
description = "Synchronize your DNS to multiple providers from a simple DSL";
homepage = "https://dnscontrol.org/";
changelog = "https://github.com/StackExchange/dnscontrol/releases/tag/${src.rev}";
license = licenses.mit;
maintainers = with maintainers; [ SuperSandro2000 ];
mainProgram = "dnscontrol";
};
}