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: 1 addition & 1 deletion doc/release-notes/rl-2605.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@

- `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.
- `nodejs-slim` has a `npm` and a `corepack` outputs, 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.

Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/web/nodejs/corepack.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ stdenv.mkDerivation {
pname = "corepack-nodejs";
inherit (nodejs) version;

nativeBuildInputs = [ nodejs ];
nativeBuildInputs = [ nodejs.corepack ];
buildInputs = [ nodejs ];

dontUnpack = true;

Expand Down
22 changes: 17 additions & 5 deletions pkgs/development/web/nodejs/nodejs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ let
builtins.attrNames sharedLibDeps
);

bundlesCorepack = !lib.versionAtLeast version "25.0.0";

# Currently stdenv sets CC/LD/AR/etc environment variables to program names
# instead of absolute paths. If we add cctools to nativeBuildInputs, that
# would shadow stdenv’s bintools and potentially break other parts of the
Expand Down Expand Up @@ -275,6 +277,7 @@ let
"libv8"
"npm"
]
++ lib.optional bundlesCorepack "corepack"
++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "dev" ];
setOutputFlags = false;
moveToDev = false;
Expand Down Expand Up @@ -353,6 +356,7 @@ let

postPatch = ''
substituteInPlace tools/install.py \
--replace-fail ' corepack_files(options, action)' " oip=options.install_path;options.install_path='$corepack';corepack_files(options, action);options.install_path=oip" \
--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 ''
Expand Down Expand Up @@ -505,21 +509,29 @@ let
outputChecks = {
out = {
disallowedReferences = [
"libv8"
"npm"
]
++ lib.optional bundlesCorepack "corepack";
};
corepack = {
disallowedReferences = [
"libv8"
"npm"
];
};
libv8 = {
disallowedReferences = [
"out"
"npm"
];
]
++ lib.optional bundlesCorepack "corepack";
};
npm = {
disallowedReferences = [
"out"
"libv8"
];
]
++ lib.optional bundlesCorepack "corepack";
};
};

Expand Down Expand Up @@ -560,8 +572,6 @@ let
''
+ ''

HOST_PATH=$out/bin patchShebangs --host $out

${lib.optionalString canExecute ''
$out/bin/node --completion-bash > node.bash
installShellCompletion node.bash
Expand Down Expand Up @@ -609,6 +619,8 @@ let
'';

postFixup = ''
HOST_PATH=$out/bin patchShebangs --host $out ${lib.optionalString bundlesCorepack "$corepack"} $npm

for dir in "$npm/lib/node_modules/npm/man/"*; do
mkdir -p $npm/share/man/$(basename "$dir")
for page in "$dir"/*; do
Expand Down
14 changes: 14 additions & 0 deletions pkgs/development/web/nodejs/symlink.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
lib,
nodejs-slim,
symlinkJoin,
}:
symlinkJoin {
pname = "nodejs";
inherit (nodejs-slim) version passthru meta;
paths = [
nodejs-slim
nodejs-slim.npm
]
++ lib.optional (builtins.hasAttr "corepack" nodejs-slim) nodejs-slim.corepack;
}
36 changes: 4 additions & 32 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2876,47 +2876,19 @@ with pkgs;
nodejs-slim = nodejs-slim_24;

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
];
};
nodejs_20 = callPackage ../development/web/nodejs/symlink.nix { nodejs-slim = nodejs-slim_20; };
corepack_20 = callPackage ../development/web/nodejs/corepack.nix { nodejs = nodejs-slim_20; };

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
];
};
nodejs_22 = callPackage ../development/web/nodejs/symlink.nix { nodejs-slim = nodejs-slim_22; };
corepack_22 = callPackage ../development/web/nodejs/corepack.nix { nodejs = nodejs-slim_22; };

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
];
};
nodejs_24 = callPackage ../development/web/nodejs/symlink.nix { nodejs-slim = nodejs-slim_24; };
corepack_24 = callPackage ../development/web/nodejs/corepack.nix { nodejs = nodejs-slim_24; };

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
];
};
nodejs_25 = callPackage ../development/web/nodejs/symlink.nix { nodejs-slim = nodejs-slim_25; };

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