depot/third_party/nixpkgs/pkgs/applications/networking/dnscontrol/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

48 lines
1.3 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, dnscontrol }:
buildGoModule rec {
pname = "dnscontrol";
version = "4.12.0";
src = fetchFromGitHub {
owner = "StackExchange";
repo = "dnscontrol";
rev = "v${version}";
hash = "sha256-W1X/d2Xf31xQWZH7ShH8Y6axhhyTOqxE/EjxNvR6pBU=";
};
vendorHash = "sha256-Dz45h33Rv4Pf5Lo0aok37MNrcbT8f/xrPPkGJMNBo8Y=";
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";
};
}