From 5d2b0d4ad96b1a36cc70e0139215b62cb3b9e900 Mon Sep 17 00:00:00 2001 From: Robert Rose Date: Mon, 7 Oct 2024 13:49:25 +0200 Subject: [PATCH] k3s: set meta.position to respective version file Formerly, meta.position used the default, i.e. getting the position of `meta.description`, which resulted in all k3s versions setting `meta.position` to the generic builder script (pkgs/applications/networking/cluster/k3s/builder.nix). This had the effect that `nixpkgs-update` couldn't find the derivation files and automatic updates failed for all k3s versions. This commit explicitly sets `meta.position` to the position of the `k3sVersion` attribute, which points to the version file of the respective version (e.g. pkgs/applications/networking/cluster/k3s/1_31/versions.nix). This solves problems during automatic updates and provides version-specific information in `meta.position`. --- pkgs/applications/networking/cluster/k3s/builder.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/cluster/k3s/builder.nix b/pkgs/applications/networking/cluster/k3s/builder.nix index 8d66882a8a97..abf25306acab 100644 --- a/pkgs/applications/networking/cluster/k3s/builder.nix +++ b/pkgs/applications/networking/cluster/k3s/builder.nix @@ -23,7 +23,7 @@ lib: # run `grep github.com/kubernetes-sigs/cri-tools go.mod | head -n1 | awk '{print $4}'` in the k3s repo at the tag criCtlVersion, updateScript ? null, -}: +}@attrs: # builder.nix contains a "builder" expression that, given k3s version and hash # variables, creates a package for that version. @@ -325,6 +325,7 @@ in buildGoModule rec { pname = "k3s"; version = k3sVersion; + pos = builtins.unsafeGetAttrPos "k3sVersion" attrs; tags = [ "libsqlite3"