nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 48 lines 1.1 kB view raw
1{ 2 lib, 3 buildGoModule, 4 fetchFromGitHub, 5 installShellFiles, 6}: 7 8buildGoModule rec { 9 pname = "hostctl"; 10 version = "1.1.4"; 11 12 src = fetchFromGitHub { 13 owner = "guumaster"; 14 repo = "hostctl"; 15 rev = "v${version}"; 16 hash = "sha256-9BbPHqAZKw8Rpjpdd/e9ip3V0Eh06tEFt/skQ97ij4g="; 17 }; 18 19 vendorHash = "sha256-+p1gIqklTyd/AU1q0zbQN4BwxOM910fBFmkqvbFAbZA="; 20 21 nativeBuildInputs = [ 22 installShellFiles 23 ]; 24 25 ldflags = [ 26 "-s" 27 "-w" 28 "-X github.com/guumaster/hostctl/cmd/hostctl/actions.version=${version}" 29 ]; 30 31 postInstall = '' 32 installShellCompletion --cmd hostctl \ 33 --bash <($out/bin/hostctl completion bash) \ 34 --zsh <($out/bin/hostctl completion zsh) 35 ''; 36 37 meta = with lib; { 38 description = "CLI tool to manage the /etc/hosts file"; 39 longDescription = '' 40 This tool gives you more control over the use of your hosts file. 41 You can have multiple profiles and switch them on/off as you need. 42 ''; 43 homepage = "https://guumaster.github.io/hostctl/"; 44 license = licenses.mit; 45 maintainers = with maintainers; [ ]; 46 mainProgram = "hostctl"; 47 }; 48}