2023-04-07 07:05:22 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub }:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "rke2";
|
2023-07-17 06:56:33 +00:00
|
|
|
version = "1.27.3+rke2r1";
|
2023-04-07 07:05:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rancher";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-07-17 06:56:33 +00:00
|
|
|
hash = "sha256-M/3F97iNeXdMMhs0eoPODeBC6Jp+yo/PwlPiG28SfYU=";
|
2023-04-07 07:05:22 +00:00
|
|
|
};
|
|
|
|
|
2023-07-17 06:56:33 +00:00
|
|
|
vendorHash = "sha256-7Za8PQr22kvZBvoYRVbI4bXUvGWkfILQC+kAmw9ZCro=";
|
2023-04-07 07:05:22 +00:00
|
|
|
|
2023-07-17 06:56:33 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Patch the build scripts so they work in the Nix build environment.
|
|
|
|
patchShebangs ./scripts
|
2023-04-07 07:05:22 +00:00
|
|
|
|
2023-07-17 06:56:33 +00:00
|
|
|
# Disable the static build as it breaks.
|
|
|
|
sed -e 's/STATIC_FLAGS=.*/STATIC_FLAGS=/g' -i scripts/build-binary
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
DRONE_TAG="v${version}" ./scripts/build-binary
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -D ./bin/rke2 $out/bin/rke2
|
|
|
|
'';
|
2023-04-07 07:05:22 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/rancher/rke2";
|
|
|
|
description = "RKE2, also known as RKE Government, is Rancher's next-generation Kubernetes distribution.";
|
|
|
|
changelog = "https://github.com/rancher/rke2/releases/tag/v${version}";
|
|
|
|
license = licenses.asl20;
|
2023-07-17 06:56:33 +00:00
|
|
|
maintainers = with maintainers; [ zimbatm zygot ];
|
2023-04-07 07:05:22 +00:00
|
|
|
};
|
|
|
|
}
|