nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 55 lines 1.4 kB view raw
1{ 2 lib, 3 stdenv, 4 buildGoModule, 5 fetchFromGitHub, 6 installShellFiles, 7 versionCheckHook, 8 nix-update-script, 9}: 10 11buildGoModule (finalAttrs: { 12 pname = "pangolin-cli"; 13 version = "0.2.0"; 14 15 src = fetchFromGitHub { 16 owner = "fosrl"; 17 repo = "cli"; 18 tag = finalAttrs.version; 19 hash = "sha256-NR8GaOtFjOk6LLTdtDw6Nu691B76bPwllA2EOPSaM94="; 20 }; 21 22 patches = [ ./use-tagged-newt-and-olm.patch ]; 23 24 vendorHash = "sha256-7LPnmbrIgWV5p4KCHfVVljRvadtZfg2FwLWIE/m3pi4="; 25 26 nativeBuildInputs = [ installShellFiles ]; 27 28 postInstall = '' 29 mv $out/bin/cli $out/bin/pangolin 30 '' 31 + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' 32 installShellCompletion --cmd pangolin \ 33 --bash <($out/bin/pangolin completion bash) \ 34 --fish <($out/bin/pangolin completion fish) \ 35 --zsh <($out/bin/pangolin completion zsh) 36 ''; 37 38 doInstallCheck = true; 39 nativeInstallCheckInputs = [ versionCheckHook ]; 40 versionCheckKeepEnvironment = [ "HOME" ]; 41 versionCheckProgramArg = "version"; 42 43 passthru.updateScript = nix-update-script { }; 44 45 meta = { 46 description = "Pangolin CLI tool and VPN client"; 47 homepage = "https://github.com/fosrl/cli"; 48 changelog = "https://github.com/fosrl/cli/releases/tag/${finalAttrs.version}"; 49 license = lib.licenses.agpl3Only; 50 maintainers = with lib.maintainers; [ 51 water-sucks 52 ]; 53 mainProgram = "pangolin"; 54 }; 55})