depot/pkgs/by-name/mo/mosdns/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

53 lines
1.2 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
testers,
mosdns,
stdenv,
installShellFiles,
}:
buildGoModule rec {
pname = "mosdns";
version = "5.3.3";
src = fetchFromGitHub {
owner = "IrineSistiana";
repo = "mosdns";
rev = "refs/tags/v${version}";
hash = "sha256-nSqSfbpi91W28DaLjCsWlPiLe1gLVHeZnstktc/CLag=";
};
vendorHash = "sha256-RpvWkIDhHSNbdkpBCcXYbbvbmGiG15qyB5aEJRmg9s4=";
nativeBuildInputs = [ installShellFiles ];
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd mosdns \
--bash <($out/bin/mosdns completion bash) \
--fish <($out/bin/mosdns completion fish) \
--zsh <($out/bin/mosdns completion zsh)
'';
passthru.tests = {
version = testers.testVersion {
package = mosdns;
command = "${lib.getExe mosdns} version";
};
};
meta = {
description = "Modular, pluggable DNS forwarder";
homepage = "https://github.com/IrineSistiana/mosdns";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ moraxyc ];
mainProgram = "mosdns";
};
}