nixpkgs/pkgs/applications/networking/cluster/rke2/default.nix
Jonas Chevalier 76f5020eb9
rke2: 1.27.2+rke2r1 -> 1.27.3+rke2r1 (#243712)
* rke2: 1.27.2+rke2r1 -> 1.27.3+rke2r1

* rke2: fix embedded versions

Use the provided scripts to build the project, in order to minimize the
differences between the Nix and the upstream distribution.

Among other things, our build wasn't embedding the docker image tags in
the binary, and that resulted in the binary trying to load "latest"
images, failing in the process.

* rke2: add zimbatm as a maintainer
2023-07-17 08:56:33 +02:00

40 lines
1.1 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "rke2";
version = "1.27.3+rke2r1";
src = fetchFromGitHub {
owner = "rancher";
repo = pname;
rev = "v${version}";
hash = "sha256-M/3F97iNeXdMMhs0eoPODeBC6Jp+yo/PwlPiG28SfYU=";
};
vendorHash = "sha256-7Za8PQr22kvZBvoYRVbI4bXUvGWkfILQC+kAmw9ZCro=";
postPatch = ''
# Patch the build scripts so they work in the Nix build environment.
patchShebangs ./scripts
# 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
'';
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;
maintainers = with maintainers; [ zimbatm zygot ];
};
}