Luke Granger-Brown
57725ef3ec
git-subtree-dir: third_party/nixpkgs git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
48 lines
1.3 KiB
Nix
48 lines
1.3 KiB
Nix
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, dnscontrol }:
|
|
|
|
buildGoModule rec {
|
|
pname = "dnscontrol";
|
|
version = "4.14.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "StackExchange";
|
|
repo = "dnscontrol";
|
|
rev = "v${version}";
|
|
hash = "sha256-FDxNJ6pOigasulxtAAnvHfWHQ3Ji459IQScA4dld9KQ=";
|
|
};
|
|
|
|
vendorHash = "sha256-aqS5esDroGg83NJygX8tW8P0U4YCkll98KmAfya6lKM=";
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
subPackages = [ "." ];
|
|
|
|
ldflags = [ "-s" "-w" "-X=main.version=${version}" ];
|
|
|
|
postInstall = ''
|
|
installShellCompletion --cmd dnscontrol \
|
|
--bash <($out/bin/dnscontrol shell-completion bash) \
|
|
--zsh <($out/bin/dnscontrol shell-completion zsh)
|
|
'';
|
|
|
|
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";
|
|
};
|
|
}
|