Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/release-notes/rl-2605.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@
- `services.openssh.settings.AcceptEnv` now explicitly defined as an option that takes a list of strings, to facilitate option merging. Setting it to a string value is no longer supported.
- `nodejs-slim` has a `npm` output, and `nodejs` no longer has a `libv8` output.
- All Xfce packages have been moved to top level (e.g. if you previously added `pkgs.xfce.xfce4-whiskermenu-plugin` to `environment.systemPackages`, you will need to change it to `pkgs.xfce4-whiskermenu-plugin`). The `xfce` scope will be removed in NixOS 26.11.
- `vimPlugins.nvim-treesitter` has been updated to `main` branch, which is a full and incompatible rewrite. If you can't or don't want to update, you should use `vimPlugins.nvim-treesitter-legacy`.
Expand Down
3 changes: 2 additions & 1 deletion pkgs/by-name/th/thelounge/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
fetchFromGitHub,
fetchYarnDeps,
nodejs,
nodejs-slim,
yarn,
fixup-yarn-lock,
python3,
Expand Down Expand Up @@ -84,7 +85,7 @@ stdenv.mkDerivation (finalAttrs: {
rm -rf node_modules/sqlite3/build-tmp-napi-v6/{Release/obj.target,node_sqlite3.target.mk}
'';

disallowedReferences = [ nodejs.src ];
disallowedReferences = [ nodejs-slim.src ];

dontNpmPrune = true;

Expand Down
7 changes: 4 additions & 3 deletions pkgs/by-name/x2/x2t/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
jdk,
lib,
nodejs_22,
nodejs-slim_22,
openssl,
pkg-config,
python3,
Expand Down Expand Up @@ -704,7 +705,7 @@ let
qmakeFlags
++ icuQmakeFlags
++ [
# c++1z for nodejs_22.libv8 (20 seems to produce errors around 'is_void_v' there)
# c++1z for nodejs-slim_22.libv8 (20 seems to produce errors around 'is_void_v' there)
# c++ 20 for nodejs_23.libv8
"CONFIG+=c++2a"
# v8_base.h will set nMaxVirtualMemory to 4000000000/5000000000
Expand Down Expand Up @@ -735,8 +736,8 @@ let
echo "== v8 =="
mkdir -p Common/3dParty/v8_89/v8/out.gn/linux_64
# using nodejs_22 here is a workaround for https://github.com/NixOS/nixpkgs/issues/477805
ln -s ${nodejs_22.libv8}/lib Common/3dParty/v8_89/v8/out.gn/linux_64/obj
tar xf ${nodejs_22.libv8.src} --one-top-level=/tmp/xxxxx
ln -s ${nodejs-slim_22.libv8}/lib Common/3dParty/v8_89/v8/out.gn/linux_64/obj
tar xf ${nodejs-slim_22.libv8.src} --one-top-level=/tmp/xxxxx
for i in /tmp/xxxxx/*/deps/v8/*; do
cp -r $i Common/3dParty/v8_89/v8/
done
Expand Down
6 changes: 3 additions & 3 deletions pkgs/development/r-modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ let
rustc
];
vdiffr = [ pkgs.libpng.dev ];
V8 = [ pkgs.nodejs_22.libv8 ]; # when unpinning the version, don't forget about the other usages later
V8 = [ pkgs.nodejs-slim_22.libv8 ]; # when unpinning the version, don't forget about the other usages later
xactonomial = with pkgs; [
cargo
rustc
Expand Down Expand Up @@ -2515,8 +2515,8 @@ let

preConfigure = ''
# when unpinning the version, don't forget about the other usage earlier
export INCLUDE_DIR=${pkgs.nodejs_22.libv8}/include
export LIB_DIR=${pkgs.nodejs_22.libv8}/lib
export INCLUDE_DIR=${pkgs.nodejs-slim_22.libv8}/include
export LIB_DIR=${pkgs.nodejs-slim_22.libv8}/lib
patchShebangs configure
'';

Expand Down
6 changes: 3 additions & 3 deletions pkgs/development/ruby-modules/gem-config/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
which,
libiconv,
libpq,
nodejs,
nodejs-slim,
clang,
sqlite,
zlib,
Expand Down Expand Up @@ -338,7 +338,7 @@ in

mini_racer = attrs: {
buildFlags = [
"--with-v8-dir=\"${nodejs.libv8}\""
"--with-v8-dir=\"${nodejs-slim.libv8}\""
];
dontBuild = false;
postPatch = ''
Expand Down Expand Up @@ -699,7 +699,7 @@ in
};

execjs = attrs: {
propagatedBuildInputs = [ nodejs.libv8 ];
propagatedBuildInputs = [ nodejs-slim.libv8 ];
};

libxml-ruby = attrs: {
Expand Down
56 changes: 41 additions & 15 deletions pkgs/development/web/nodejs/nodejs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
}:

{
enableNpm ? true,
version,
sha256,
patches ? [ ],
Expand All @@ -68,7 +67,7 @@ let
majorVersion = lib.versions.major version;
minorVersion = lib.versions.minor version;

pname = if enableNpm then "nodejs" else "nodejs-slim";
pname = "nodejs-slim";

canExecute = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
emulator = stdenv.hostPlatform.emulator buildPackages;
Expand Down Expand Up @@ -274,6 +273,7 @@ let
outputs = [
"out"
"libv8"
"npm"
]
++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "dev" ];
setOutputFlags = false;
Expand All @@ -299,7 +299,6 @@ let
"--emulator=${emulator}"
]
++ lib.optionals (lib.versionOlder version "19") [ "--without-dtrace" ]
++ lib.optionals (!enableNpm) [ "--without-npm" ]
++ lib.concatMap (name: [
"--shared-${name}"
"--shared-${name}-libpath=${lib.getLib sharedLibDeps.${name}}/lib"
Expand Down Expand Up @@ -352,12 +351,17 @@ let

inherit patches;

postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
postPatch = ''
substituteInPlace tools/install.py \
--replace-fail ' npm_files(options, action)' " oip=options.install_path;options.install_path='$npm';npm_files(options, action);options.install_path=oip"
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace test/parallel/test-macos-app-sandbox.js \
--subst-var-by codesign '${darwin.sigtool}/bin/codesign'
'';

__darwinAllowLocalNetworking = true; # for tests
__structuredAttrs = true; # for outputChecks

doCheck = canExecute;

Expand Down Expand Up @@ -498,6 +502,27 @@ let
}"
];

outputChecks = {
out = {
disallowedReferences = [
"npm"
"libv8"
];
};
libv8 = {
disallowedReferences = [
"out"
"npm"
];
};
npm = {
disallowedReferences = [
"out"
"libv8"
];
};
};

sandboxProfile = ''
(allow file-read*
(literal "/Library/Keychains/System.keychain")
Expand Down Expand Up @@ -542,17 +567,9 @@ let
installShellCompletion node.bash
''}

${lib.optionalString enableNpm ''
mkdir -p $out/share/bash-completion/completions
ln -s $out/lib/node_modules/npm/lib/utils/completion.sh \
$out/share/bash-completion/completions/npm
for dir in "$out/lib/node_modules/npm/man/"*; do
mkdir -p $out/share/man/$(basename "$dir")
for page in "$dir"/*; do
ln -rs $page $out/share/man/$(basename "$dir")
done
done
''}
mkdir -p $npm/share/bash-completion/completions
ln -s $npm/lib/node_modules/npm/lib/utils/completion.sh \
$npm/share/bash-completion/completions/npm

# install the missing headers for node-gyp
# TODO: use propagatedBuildInputs instead of copying headers.
Expand Down Expand Up @@ -591,6 +608,15 @@ let
cp -r $out/include $dev/include
'';

postFixup = ''
for dir in "$npm/lib/node_modules/npm/man/"*; do
mkdir -p $npm/share/man/$(basename "$dir")
for page in "$dir"/*; do
ln -rs $page $npm/share/man/$(basename "$dir")
done
done
'';

passthru.tests = {
version = testers.testVersion {
package = self;
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/web/nodejs/v20.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
fetchpatch2,
openssl,
python3,
enableNpm ? true,
}:

let
Expand Down Expand Up @@ -35,7 +34,6 @@ let
];
in
buildNodejs {
inherit enableNpm;
version = "20.20.0";
sha256 = "5294d9d2915620e819e6892fd7e545b98d650bad36dae54e6527eaac482add98";
patches = [
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/web/nodejs/v22.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
fetchpatch2,
openssl,
python3,
enableNpm ? true,
}:

let
Expand All @@ -22,7 +21,6 @@ let
[ ];
in
buildNodejs {
inherit enableNpm;
version = "22.22.0";
sha256 = "4c138012bb5352f49822a8f3e6d1db71e00639d0c36d5b6756f91e4c6f30b683";
patches =
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/web/nodejs/v24.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
fetchpatch2,
openssl,
python3,
enableNpm ? true,
}:

let
Expand All @@ -24,7 +23,6 @@ let
[ ];
in
buildNodejs {
inherit enableNpm;
version = "24.13.0";
sha256 = "320fe909cbb347dcf516201e4964ef177b8138df9a7f810d0d54950481b3158b";
patches =
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/web/nodejs/v25.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
fetchpatch2,
openssl,
python3,
enableNpm ? true,
}:

let
Expand All @@ -24,7 +23,6 @@ let
[ ];
in
buildNodejs {
inherit enableNpm;
version = "25.6.0";
sha256 = "9db6848c802b1981c0faeb71a5b8cc79913f82a747f7f1d50260c6d2f781ef7e";
patches =
Expand Down
4 changes: 2 additions & 2 deletions pkgs/servers/sql/postgresql/ext/plv8/package.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
fetchFromGitHub,
lib,
nodejs_20,
nodejs-slim_20,
perl,
postgresql,
postgresqlBuildExtension,
Expand All @@ -13,7 +13,7 @@
}:

let
libv8 = nodejs_20.libv8;
libv8 = nodejs-slim_20.libv8;
in
postgresqlBuildExtension (finalAttrs: {
pname = "plv8";
Expand Down
10 changes: 5 additions & 5 deletions pkgs/servers/web-apps/discourse/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
fetchPnpmDeps,
pnpmConfigHook,
svgo,
nodejs_22,
nodejs-slim_22,
jq,
moreutils,
terser,
Expand Down Expand Up @@ -72,7 +72,7 @@ let
gnutar
git
brotli
nodejs_22
nodejs-slim_22

# Misc required system utils
which
Expand Down Expand Up @@ -193,9 +193,9 @@ let
cd ../..

mkdir -p vendor/v8/${stdenv.hostPlatform.system}/libv8/obj/
ln -s "${nodejs_22.libv8}/lib/libv8.a" vendor/v8/${stdenv.hostPlatform.system}/libv8/obj/libv8_monolith.a
ln -s "${nodejs-slim_22.libv8}/lib/libv8.a" vendor/v8/${stdenv.hostPlatform.system}/libv8/obj/libv8_monolith.a

ln -s ${nodejs_22.libv8}/include vendor/v8/include
ln -s ${nodejs-slim_22.libv8}/include vendor/v8/include

mkdir -p ext/libv8-node
echo '--- !ruby/object:Libv8::Node::Location::Vendor {}' >ext/libv8-node/.location.yml
Expand Down Expand Up @@ -318,7 +318,7 @@ let
terser
jq
moreutils
nodejs_22
nodejs-slim_22
pnpmConfigHook
pnpm_9
];
Expand Down
50 changes: 39 additions & 11 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2872,20 +2872,48 @@ with pkgs;
nodejs = nodejs_24;
nodejs-slim = nodejs-slim_24;

nodejs_20 = callPackage ../development/web/nodejs/v20.nix { };
nodejs-slim_20 = callPackage ../development/web/nodejs/v20.nix { enableNpm = false; };
corepack_20 = callPackage ../development/web/nodejs/corepack.nix { nodejs = nodejs_20; };
nodejs-slim_20 = callPackage ../development/web/nodejs/v20.nix { };
nodejs_20 = symlinkJoin {
pname = "nodejs";
inherit (nodejs-slim_20) version passthru meta;
paths = [
nodejs-slim_20
nodejs-slim_20.npm
];
};
corepack_20 = callPackage ../development/web/nodejs/corepack.nix { nodejs = nodejs-slim_20; };

nodejs_22 = callPackage ../development/web/nodejs/v22.nix { };
nodejs-slim_22 = callPackage ../development/web/nodejs/v22.nix { enableNpm = false; };
corepack_22 = callPackage ../development/web/nodejs/corepack.nix { nodejs = nodejs_22; };
nodejs-slim_22 = callPackage ../development/web/nodejs/v22.nix { };
nodejs_22 = symlinkJoin {
pname = "nodejs";
inherit (nodejs-slim_22) version passthru meta;
paths = [
nodejs-slim_22
nodejs-slim_22.npm
];
};
corepack_22 = callPackage ../development/web/nodejs/corepack.nix { nodejs = nodejs-slim_22; };

nodejs_24 = callPackage ../development/web/nodejs/v24.nix { };
nodejs-slim_24 = callPackage ../development/web/nodejs/v24.nix { enableNpm = false; };
corepack_24 = callPackage ../development/web/nodejs/corepack.nix { nodejs = nodejs_24; };
nodejs-slim_24 = callPackage ../development/web/nodejs/v24.nix { };
nodejs_24 = symlinkJoin {
pname = "nodejs";
inherit (nodejs-slim_24) version passthru meta;
paths = [
nodejs-slim_24
nodejs-slim_24.npm
];
};
corepack_24 = callPackage ../development/web/nodejs/corepack.nix { nodejs = nodejs-slim_24; };

nodejs_25 = callPackage ../development/web/nodejs/v25.nix { };
nodejs-slim_25 = callPackage ../development/web/nodejs/v25.nix { enableNpm = false; };
nodejs-slim_25 = callPackage ../development/web/nodejs/v25.nix { };
nodejs_25 = symlinkJoin {
pname = "nodejs";
inherit (nodejs-slim_25) version passthru meta;
paths = [
nodejs-slim_25
nodejs-slim_25.npm
];
};

# Update this when adding the newest nodejs major version!
nodejs_latest = nodejs_25;
Expand Down
Loading