diff --git a/pkgs/applications/networking/cluster/rancher/default.nix b/pkgs/applications/networking/cluster/rancher/default.nix new file mode 100644 index 000000000000..665b2091edc6 --- /dev/null +++ b/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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fb9bfad5f8f2..7c8cbec08a9e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -32150,6 +32150,8 @@ with pkgs; rargs = callPackage ../tools/misc/rargs { }; + rancher = callPackage ../applications/networking/cluster/rancher { }; + rauc = callPackage ../tools/misc/rauc { }; redprl = callPackage ../applications/science/logic/redprl { };