@@ -44,14 +44,16 @@ with lib;
4444# Those pieces of software we entirely ignore upstream's handling of, and just
4545# make sure they're in the path if desired.
4646let
47− k3sVersion = "1.20.6+k3s1"; # k3s git tag
48− traefikChartVersion = "1.81.0"; # taken from ./scripts/download at the above k3s tag
49− k3sRootVersion = "0.8.1"; # taken from ./scripts/download at the above k3s tag
50− k3sCNIVersion = "0.8.6-k3s1"; # taken from ./scripts/version.sh at the above k3s tag
47+ k3sVersion = "1.21.0+k3s1"; # k3s git tag
48+ k3sCommit = "2705431d9645d128441c578309574cd262285ae6"; # k3s git commit at the above version
49+
50+ traefikChartVersion = "9.18.2"; # taken from ./scripts/download at TRAEFIK_VERSION
51+ k3sRootVersion = "0.8.1"; # taken from ./scripts/download at ROOT_VERSION
52+ k3sCNIVersion = "0.8.6-k3s1"; # taken from ./scripts/version.sh at VERSION_CNIPLUGINS
5153 # bundled into the k3s binary
5254 traefikChart = fetchurl {
53− url = "https://kubernetes-charts.storage.googleapis.com/traefik-${traefikChartVersion}.tgz";
54− sha256 = "1aqpzgjlvqhil0g3angz94zd4xbl4iq0qmpjcy5aq1xv9qciwdi9";
55+ url = "https://helm.traefik.io/traefik/traefik-${traefikChartVersion}.tgz";
56+ sha256 = "sha256-9d7p0ngyMN27u4OPgz7yI14Zj9y36t9o/HMX5wyDpUI=";
5557 };
5658 # so, k3s is a complicated thing to package
5759 # This derivation attempts to avoid including any random binaries from the
@@ -95,8 +97,7 @@ let
9597 k3sRepo = fetchgit {
9698 url = "https://github.com/k3s-io/k3s";
9799 rev = "v${k3sVersion}";
98− leaveDotGit = true; # ./scripts/version.sh depends on git
99− sha256 = "sha256-IIZotJKQ/+WNmfcEJU5wFtZBufWjUp4MeVCRk4tSjyQ=";
100+ sha256 = "sha256-xsXxf2ZYrkpOHlSFqTsHwWF3kChUjxWRjyDR3Dhg2ho=";
100101 };
101102 # Stage 1 of the k3s build:
102103 # Let's talk about how k3s is structured.
@@ -134,9 +135,13 @@ let
134135 # those.
135136 patches = [ ./patches/0002-Add-nixpkgs-patches.patch ];
136137
137− nativeBuildInputs = [ git pkg-config ];
138+ nativeBuildInputs = [ pkg-config ];
138139 buildInputs = [ libseccomp ];
139140
141+ # Versioning info for build script
142+ DRONE_TAG = "v${version}";
143+ DRONE_COMMIT = k3sCommit;
144+
140145 buildPhase = ''
141146 pushd go/src/${goPackagePath}
142147
@@ -175,7 +180,7 @@ let
175180 # See the above comment in k3sBuildStage1
176181 patches = [ ./patches/0002-Add-nixpkgs-patches.patch ];
177182
178− nativeBuildInputs = [ git pkg-config zstd ];
183+ nativeBuildInputs = [ pkg-config zstd ];
179184 # These dependencies are embedded as compressed files in k3s at runtime.
180185 # Propagate them to avoid broken runtime references to libraries.
181186 propagatedBuildInputs = [ k3sPlugins k3sBuildStage1 runc ];
@@ -186,6 +191,9 @@ let
186191 else if stdenv.hostPlatform.system == "aarch64-linux" then "-arm64"
187192 else throw "k3s isn't being built for ${stdenv.hostPlatform.system} yet.";
188193
194+ DRONE_TAG = "v${version}";
195+ DRONE_COMMIT = k3sCommit;
196+
189197 # In order to build the thick k3s binary (which is what
190198 # ./scripts/package-cli does), we need to get all the binaries that script
191199 # expects in place.