From 19240799ee376781afa48c95a329cda71b8e1dad Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Mon, 17 Nov 2025 10:48:16 +0100 Subject: [PATCH] crun: use `finalAttrs` pattern --- pkgs/by-name/cr/crun/package.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/cr/crun/package.nix b/pkgs/by-name/cr/crun/package.nix index d180b228c02e..4163ccddcf0c 100644 --- a/pkgs/by-name/cr/crun/package.nix +++ b/pkgs/by-name/cr/crun/package.nix @@ -38,14 +38,14 @@ let ]; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "crun"; version = "1.25.1"; src = fetchFromGitHub { owner = "containers"; repo = "crun"; - rev = version; + tag = finalAttrs.version; hash = "sha256-WBAwyDODMrUDlgonRbxaNQ+aN8K6YicY2JVArXDJem8="; fetchSubmodules = true; }; @@ -68,13 +68,15 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; strictDeps = true; - NIX_LDFLAGS = "-lcriu"; + env = { + NIX_LDFLAGS = "-lcriu"; + }; # we need this before autoreconfHook does its thing in order to initialize # config.h with the correct values postPatch = '' - echo ${version} > .tarball-version - echo '#define GIT_VERSION "${src.rev}"' > git-version.h + echo ${finalAttrs.version} > .tarball-version + echo '#define GIT_VERSION "${finalAttrs.src.tag}"' > git-version.h ${lib.concatMapStringsSep "\n" ( e: "substituteInPlace Makefile.am --replace 'tests/${e}' ''" @@ -86,7 +88,7 @@ stdenv.mkDerivation rec { passthru.tests = { inherit (nixosTests) podman; }; meta = { - changelog = "https://github.com/containers/crun/releases/tag/${version}"; + changelog = "https://github.com/containers/crun/releases/tag/${finalAttrs.version}"; description = "Fast and lightweight fully featured OCI runtime and C library for running containers"; homepage = "https://github.com/containers/crun"; license = lib.licenses.gpl2Plus; @@ -94,4 +96,4 @@ stdenv.mkDerivation rec { teams = [ lib.teams.podman ]; mainProgram = "crun"; }; -} +})