From 7863314bb615170a94745bafc536b5a339161576 Mon Sep 17 00:00:00 2001 From: Kody Low Date: Mon, 19 Oct 2026 14:03:48 +0000 Subject: [PATCH] Provide Bun 1.4.3 in Node.js and Bun modules Share the pinned toolchain and upgrade older Bun module IDs to bun-1.4. Assisted-by: Replit --- README.md | 4 ++++ pkgs/bun/default.nix | 12 ++++++++++++ pkgs/modules/bun/default.nix | 8 +------- pkgs/modules/default.nix | 2 +- pkgs/modules/nodejs/default.nix | 2 +- pkgs/upgrade-map/default.nix | 1 + 6 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 pkgs/bun/default.nix diff --git a/README.md b/README.md index fee69f77..029ee3f3 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,10 @@ The old Python and Node.js Prybar IDs now use the standard Python 3.10 and Node.js 20 file runners, not Prybar. Projects using retired IDs get the newer runtime and tools with this bundle and may need code or dependency changes. +Node.js modules include the shared Bun 1.4.3 toolchain, including `bun check`. +The standalone module is `bun-1.4`; earlier Bun IDs resolve to it through the +upgrade map. Node.js projects do not need a second Bun module. + ## Building For each of the following examples, the build result will be found in a file or directory named `result`. diff --git a/pkgs/bun/default.nix b/pkgs/bun/default.nix new file mode 100644 index 00000000..54838798 --- /dev/null +++ b/pkgs/bun/default.nix @@ -0,0 +1,12 @@ +{ bun +, fetchurl +}: + +# ponytail: x86_64-linux module outputs; add platform sources if module outputs expand. +bun.overrideAttrs rec { + version = "1.4.3"; + src = fetchurl { + url = "https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-linux-x64.zip"; + hash = "sha256-PnMFKNiXdfA/h/BcBnh8TfQJnQo38/JS57gpyyOBbhg="; + }; +} diff --git a/pkgs/modules/bun/default.nix b/pkgs/modules/bun/default.nix index 397a8c42..c1779bdc 100644 --- a/pkgs/modules/bun/default.nix +++ b/pkgs/modules/bun/default.nix @@ -1,10 +1,4 @@ -# NOTE: Unlike Node.js, nixpkgs doesn't provide versioned bun attributes (e.g., bun_1_3). -# This module uses pkgs.bun which tracks the latest version. -# -# When nixpkgs updates bun to a new major.minor version: -# 1. Add the previous version to pkgs/historical-modules/default.nix, pinned to the -# commit before the nixpkgs update -# 2. Update pkgs/upgrade-map/default.nix to chain the old version to the new one +# When the pinned Bun minor version changes, extend pkgs/upgrade-map. { bun }: { pkgs, lib, ... }: diff --git a/pkgs/modules/default.nix b/pkgs/modules/default.nix index 96f08482..7bc4a02c 100644 --- a/pkgs/modules/default.nix +++ b/pkgs/modules/default.nix @@ -79,7 +79,7 @@ let }) (import ./bash) (import ./bun { - bun = pkgs.bun; + bun = pkgs.callPackage ../bun { }; }) (import ./c) (import ./cpp) diff --git a/pkgs/modules/nodejs/default.nix b/pkgs/modules/nodejs/default.nix index 8b638247..9bd3a731 100644 --- a/pkgs/modules/nodejs/default.nix +++ b/pkgs/modules/nodejs/default.nix @@ -6,7 +6,7 @@ let short-version = lib.versions.major nodejs.version; - bun = pkgs.bun; + bun = pkgs.callPackage ../../bun { }; nodepkgs = pkgs.nodePackages.override { inherit nodejs; diff --git a/pkgs/upgrade-map/default.nix b/pkgs/upgrade-map/default.nix index 7a337d83..ee8b0ff6 100644 --- a/pkgs/upgrade-map/default.nix +++ b/pkgs/upgrade-map/default.nix @@ -13,6 +13,7 @@ let "bun-1.0" = "bun-1.1"; "bun-1.1" = "bun-1.2"; "bun-1.2" = "bun-1.3"; + "bun-1.3" = "bun-1.4"; "clojure-1.11" = "clojure-1.12"; "dart-2.18" = "dart-3.8"; "dart-3.0" = "dart-3.1";