diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/cluster/rancher/default.nix')
-rw-r--r-- | nixpkgs/pkgs/applications/networking/cluster/rancher/default.nix | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/networking/cluster/rancher/default.nix b/nixpkgs/pkgs/applications/networking/cluster/rancher/default.nix new file mode 100644 index 000000000000..665b2091edc6 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/cluster/rancher/default.nix @@ -0,0 +1,41 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "rancher-cli"; + version = "2.4.13"; + + src = fetchFromGitHub { + owner = "rancher"; + repo = "cli"; + rev = "v${version}"; + sha256 = "sha256-tkAnbQP35P+ZEE/WTpjgjdmvt0eJ0esKJ+I21cWraEI="; + }; + + ldflags = [ + "-w" + "-s" + "-X main.VERSION=${version}" + "-extldflags" + "-static" + ]; + + vendorSha256 = "sha256-agXztvvrMEoa6bo/bQr3qhinOSj7bFnZ4kzTx4F0VxQ="; + + postInstall = '' + mv $out/bin/cli $out/bin/rancher + ''; + + doCheck = true; + + doInstallCheck = true; + installCheckPhase = '' + $out/bin/rancher | grep ${version} > /dev/null + ''; + + meta = with lib; { + description = "The Rancher Command Line Interface (CLI) is a unified tool for interacting with your Rancher Server"; + homepage = "https://github.com/rancher/cli"; + license = licenses.asl20; + maintainers = with maintainers; [ bryanasdev000 ]; + }; +} |