From dc531c290fc5fee849166b63691fc20f6419765f Mon Sep 17 00:00:00 2001 From: HigherOrderLogic <73709188+HigherOrderLogic@users.noreply.github.com> Date: Sun, 30 Nov 2025 18:29:02 +0000 Subject: [PATCH] tsx: modernize --- pkgs/by-name/ts/tsx/package.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/ts/tsx/package.nix b/pkgs/by-name/ts/tsx/package.nix index 7db0c2905888..1d13a1098aa1 100644 --- a/pkgs/by-name/ts/tsx/package.nix +++ b/pkgs/by-name/ts/tsx/package.nix @@ -2,35 +2,35 @@ lib, stdenv, fetchFromGitHub, - pnpm_9, + pnpm_10, fetchPnpmDeps, pnpmConfigHook, nodejs_22, versionCheckHook, }: let - pnpm' = pnpm_9.override { nodejs = nodejs_22; }; + pnpm' = pnpm_10.override { nodejs = nodejs_22; }; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "tsx"; version = "4.19.3"; src = fetchFromGitHub { owner = "privatenumber"; repo = "tsx"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-wdv2oqJNc6U0Fyv4jT+0LUcYaDfodHk1vQZGMdyFF/E="; }; pnpmDeps = fetchPnpmDeps { - inherit + inherit (finalAttrs) pname version src ; pnpm = pnpm'; fetcherVersion = 1; - hash = "sha256-57KDZ9cHb7uqnypC0auIltmYMmIhs4PWyf0HTRWEFiU="; + hash = "sha256-IDPXEmACa+JbScp+CKJLW9S4MGgfQwS4ZYMvDL++Hy4="; }; nativeBuildInputs = [ @@ -54,7 +54,7 @@ stdenv.mkDerivation rec { # because tsx uses semantic-release, the package.json has a placeholder # version number. this patches it to match the version of the nix package, # which in turn is the release version in github. - substituteInPlace package.json --replace-fail "0.0.0-semantic-release" "${version}" + substituteInPlace package.json --replace-fail "0.0.0-semantic-release" "${finalAttrs.version}" runHook postPatch ''; @@ -62,7 +62,7 @@ stdenv.mkDerivation rec { buildPhase = '' runHook preBuild - npm run build + pnpm run build # remove devDependencies that are only required to build # and package the typescript code @@ -101,4 +101,4 @@ stdenv.mkDerivation rec { maintainers = [ lib.maintainers.sdedovic ]; mainProgram = "tsx"; }; -} +})