2022-03-30 09:31:56 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
2020-11-06 00:33:48 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "hostctl";
|
2022-03-30 09:31:56 +00:00
|
|
|
version = "1.1.2";
|
2020-11-06 00:33:48 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "guumaster";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-03-30 09:31:56 +00:00
|
|
|
hash = "sha256-rvUm31WRSLusM9VGsIHKGTH6Vs8LWPtzPDs3azA710w=";
|
2020-11-06 00:33:48 +00:00
|
|
|
};
|
|
|
|
|
2021-07-24 12:14:16 +00:00
|
|
|
vendorSha256 = "sha256-rGDWrivIdl5FTu/kNR8nAfE2+1hE4cm3uDg7oBobE9M=";
|
2020-11-06 00:33:48 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/guumaster/hostctl/cmd/hostctl/actions.version=${version}"
|
|
|
|
];
|
2020-11-06 00:33:48 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd hostctl \
|
|
|
|
--bash <($out/bin/hostctl completion bash) \
|
|
|
|
--zsh <($out/bin/hostctl completion zsh)
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2022-03-30 09:31:56 +00:00
|
|
|
description = "CLI tool to manage the /etc/hosts file";
|
2020-11-06 00:33:48 +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 ];
|
|
|
|
};
|
|
|
|
}
|