From 4bd2ce3420a920ea9075ee3d6262ffe2b3e634ec Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 15 May 2024 10:28:49 +0200 Subject: [PATCH] upsun: use `finalAttrs` pattern --- pkgs/by-name/up/upsun/package.nix | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/pkgs/by-name/up/upsun/package.nix b/pkgs/by-name/up/upsun/package.nix index d47aaa1418bd..ab0bf8c85594 100644 --- a/pkgs/by-name/up/upsun/package.nix +++ b/pkgs/by-name/up/upsun/package.nix @@ -1,27 +1,27 @@ { stdenvNoCC, lib, fetchurl }: -stdenvNoCC.mkDerivation rec { +stdenvNoCC.mkDerivation (finalAttrs: { pname = "upsun"; version = "5.0.12"; src = { - x86_64-darwin = (fetchurl { - url = "https://github.com/platformsh/cli/releases/download/${version}/upsun_${version}_darwin_all.tar.gz"; + x86_64-darwin = fetchurl { + url = "https://github.com/platformsh/cli/releases/download/${finalAttrs.version}/upsun_${finalAttrs.version}_darwin_all.tar.gz"; hash = "sha256-RwTMJwvkuX/okHSyxzpvaD6uD8fheVbr7bgBC2eMQOo="; - }); - aarch64-darwin = (fetchurl { - url = "https://github.com/platformsh/cli/releases/download/${version}/upsun_${version}_darwin_all.tar.gz"; + }; + aarch64-darwin = fetchurl { + url = "https://github.com/platformsh/cli/releases/download/${finalAttrs.version}/upsun_${finalAttrs.version}_darwin_all.tar.gz"; hash = "sha256-RwTMJwvkuX/okHSyxzpvaD6uD8fheVbr7bgBC2eMQOo="; - }); - x86_64-linux = (fetchurl { - url = "https://github.com/platformsh/cli/releases/download/${version}/upsun_${version}_linux_amd64.tar.gz"; + }; + x86_64-linux = fetchurl { + url = "https://github.com/platformsh/cli/releases/download/${finalAttrs.version}/upsun_${finalAttrs.version}_linux_amd64.tar.gz"; hash = "sha256-svEPMVY7r7pAoXwFIMYqCEduqR3Nkocaguf2nIGt+G8="; - }); - aarch64-linux = (fetchurl { - url = "https://github.com/platformsh/cli/releases/download/${version}/upsun_${version}_linux_arm64.tar.gz"; + }; + aarch64-linux = fetchurl { + url = "https://github.com/platformsh/cli/releases/download/${finalAttrs.version}/upsun_${finalAttrs.version}_linux_arm64.tar.gz"; hash = "sha256-ZraS/PqSPL/kcj5o6hzDdL70IV2IWXOma6OHCiXIDQc="; - }); - }.${stdenvNoCC.system} or (throw "${pname}-${version}: ${stdenvNoCC.system} is unsupported."); + }; + }.${stdenvNoCC.system} or (throw "${finalAttrs.pname}-${finalAttrs.version}: ${stdenvNoCC.system} is unsupported."); dontConfigure = true; dontBuild = true; @@ -44,4 +44,4 @@ stdenvNoCC.mkDerivation rec { platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; }; -} +})