depot/third_party/nixpkgs/pkgs/tools/system/hostctl/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

47 lines
1.1 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
buildGoModule rec {
pname = "hostctl";
version = "1.1.4";
src = fetchFromGitHub {
owner = "guumaster";
repo = pname;
rev = "v${version}";
hash = "sha256-9BbPHqAZKw8Rpjpdd/e9ip3V0Eh06tEFt/skQ97ij4g=";
};
vendorHash = "sha256-+p1gIqklTyd/AU1q0zbQN4BwxOM910fBFmkqvbFAbZA=";
nativeBuildInputs = [
installShellFiles
];
ldflags = [
"-s"
"-w"
"-X github.com/guumaster/hostctl/cmd/hostctl/actions.version=${version}"
];
postInstall = ''
installShellCompletion --cmd hostctl \
--bash <($out/bin/hostctl completion bash) \
--zsh <($out/bin/hostctl completion zsh)
'';
meta = with lib; {
description = "CLI tool to manage the /etc/hosts file";
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 ];
mainProgram = "hostctl";
};
}