···1919, fetchurl
2020, fetchzip
2121, fetchgit
2222+, zstd
2223}:
23242425with lib;
···4344# Those pieces of software we entirely ignore upstream's handling of, and just
4445# make sure they're in the path if desired.
4546let
4646- k3sVersion = "1.19.4+k3s2"; # k3s git tag
4747+ k3sVersion = "1.20.4+k3s1"; # k3s git tag
4748 traefikChartVersion = "1.81.0"; # taken from ./scripts/download at the above k3s tag
4848- k3sRootVersion = "0.7.1"; # taken from ./scripts/download at the above k3s tag
4949+ k3sRootVersion = "0.8.1"; # taken from ./scripts/download at the above k3s tag
4950 k3sCNIVersion = "0.8.6-k3s1"; # taken from ./scripts/version.sh at the above k3s tag
5051 # bundled into the k3s binary
5152 traefikChart = fetchurl {
···6465 k3sRoot = fetchzip {
6566 # Note: marked as apache 2.0 license
6667 url = "https://github.com/k3s-io/k3s-root/releases/download/v${k3sRootVersion}/k3s-root-amd64.tar";
6767- sha256 = "1wjg54816plbdwgv0dibq6dzmcakcmx0wiqijvr4f3gsxgk59zwf";
6868+ sha256 = "sha256-r3Nkzl9ccry7cgD3YWlHvEWOsWnnFGIkyRH9sx12gks=";
6869 stripRoot = false;
6970 };
7071 k3sPlugins = buildGoPackage rec {
···9596 url = "https://github.com/k3s-io/k3s";
9697 rev = "v${k3sVersion}";
9798 leaveDotGit = true; # ./scripts/version.sh depends on git
9898- sha256 = "1qxjdgnq8mf54760f0vngcqa2y3b048pcmfsf1g593b2ij1kg1zi";
9999+ sha256 = "0rmn3nh8a94axv6lb2xjnn3gpq0scnvj69bvcs74azvw62fvq016";
99100 };
100101 # Stage 1 of the k3s build:
101102 # Let's talk about how k3s is structured.
···126127127128 src = k3sRepo;
128129129129- patches = [ ./patches/0001-Use-rm-from-path-in-go-generate.patch ./patches/0002-Add-nixpkgs-patches.patch ];
130130+ # Patch build scripts so that we can use them.
131131+ # This makes things more dynamically linked (because nix can deal with
132132+ # dynamically linked dependencies just fine), removes the upload at the
133133+ # end, and skips building runc + cni, since we have our own derivations for
134134+ # those.
135135+ patches = [ ./patches/0002-Add-nixpkgs-patches.patch ];
130136131137 nativeBuildInputs = [ git pkg-config ];
132138 buildInputs = [ libseccomp ];
···166172167173 src = k3sRepo;
168174169169- patches = [ ./patches/0001-Use-rm-from-path-in-go-generate.patch ./patches/0002-Add-nixpkgs-patches.patch ];
175175+ # See the above comment in k3sBuildStage1
176176+ patches = [ ./patches/0002-Add-nixpkgs-patches.patch ];
170177171171- nativeBuildInputs = [ git pkg-config ];
178178+ nativeBuildInputs = [ git pkg-config zstd ];
172179 # These dependencies are embedded as compressed files in k3s at runtime.
173180 # Propagate them to avoid broken runtime references to libraries.
174181 propagatedBuildInputs = [ k3sPlugins k3sBuildStage1 runc ];
···255262 # Use a wrapper script to reference all the binaries that k3s tries to
256263 # execute, but that we didn't bundle with it.
257264 installPhase = ''
265265+ runHook preInstall
258266 mkdir -p "$out/bin"
259267 makeWrapper ${k3sBin}/bin/k3s "$out/bin/k3s" \
260268 --prefix PATH : ${lib.makeBinPath k3sRuntimeDeps} \
261269 --prefix PATH : "$out/bin"
270270+ runHook postInstall
262271 '';
263272264273 meta = {