nixpkgs/pkgs/tools/system/hostctl/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.1 KiB
Nix
Raw Normal View History

2022-03-18 09:19:33 +00:00
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
2020-10-08 20:02:07 +00:00
buildGoModule rec {
pname = "hostctl";
2023-05-06 06:41:20 +00:00
version = "1.1.4";
2020-10-08 20:02:07 +00:00
src = fetchFromGitHub {
owner = "guumaster";
repo = pname;
rev = "v${version}";
2023-05-06 06:41:20 +00:00
hash = "sha256-9BbPHqAZKw8Rpjpdd/e9ip3V0Eh06tEFt/skQ97ij4g=";
2020-10-08 20:02:07 +00:00
};
2023-05-06 06:41:20 +00:00
vendorHash = "sha256-+p1gIqklTyd/AU1q0zbQN4BwxOM910fBFmkqvbFAbZA=";
2020-10-08 20:02:07 +00:00
2022-03-18 09:19:33 +00:00
nativeBuildInputs = [
installShellFiles
];
ldflags = [
"-s"
"-w"
"-X github.com/guumaster/hostctl/cmd/hostctl/actions.version=${version}"
];
2020-10-08 20:02:07 +00:00
postInstall = ''
installShellCompletion --cmd hostctl \
--bash <($out/bin/hostctl completion bash) \
--zsh <($out/bin/hostctl completion zsh)
'';
meta = with lib; {
2022-03-18 09:19:33 +00:00
description = "CLI tool to manage the /etc/hosts file";
2020-10-08 20:02:07 +00:00
longDescription = ''
This tool gives you more control over the use of your hosts file.
You can have multiple profiles and switch them on/off as you need.
'';
homepage = "https://guumaster.github.io/hostctl/";
license = licenses.mit;
maintainers = with maintainers; [ blaggacao ];
};
}