New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nodejs: use python3 if possible #84599
Conversation
1c1c8f1
to
1624329
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I think this can go directly to master
Hmm interesting it doesn't trigger a rebuild of all |
I have declared tutnix ~
% nixos-rebuild test
building Nix...
building the system configuration...
error: attribute 'npm' missing, at /home/alab/ws/nixpkgs/nixos/modules/programs/npm.nix:19:19
(use '--show-trace' to show detailed location information)
tutnix ~
% nix-build \<nixpkgs\> --no-out-link --no-build-output -A nodePackages.npm
error: attribute 'npm' in selection path 'nodePackages.npm' not found
tutnix ~
% nix-build \<nixpkgs\> --no-out-link --no-build-output -A nodePackages_10_x.npm
/nix/store/6mkiyvgphqahlzvj6w4f95qpal5jp1gd-node_npm-6.14.4
tutnix ~
% nix-build \<nixpkgs\> --no-out-link --no-build-output -A nodePackages_12_x.npm
error: attribute 'npm' in selection path 'nodePackages_12_x.npm' not found
tutnix ~
% nix-build \<nixpkgs\> --no-out-link --no-build-output -A nodePackages_13_x.npm
error: attribute 'npm' in selection path 'nodePackages_13_x.npm' not found |
@doronbehar maybe you could change this to diff --git a/nixos/modules/programs/npm.nix b/nixos/modules/programs/npm.nix
index f101a44587a..52810f526cd 100644
--- a/nixos/modules/programs/npm.nix
+++ b/nixos/modules/programs/npm.nix
@@ -14,9 +14,9 @@ in
enable = mkEnableOption "<command>npm</command> global config";
package = mkOption {
- type = types.path;
+ type = types.path or null;
description = "The npm package version / flavor to use";
- default = pkgs.nodePackages.npm;
+ default = if hasAttr "npm" pkgs.nodePackages then pkgs.nodePackages.npm else null;
example = literalExample "pkgs.nodePackages_13_x.npm";
}; or add
and update with "node-gyp",
"node-gyp-build",
"node-pre-gyp", |
Can't you use: programs.npm.package = pkgs.nodejs_latest; ?
I'm not sure I understand what kind of ability does the current module is missing. If you feel there are missing attributes to some of the |
I could :) The point is i do not use programs.npm so why should i need to set this? |
MR NixOS#84599 introduced an option that breaks rebuilding nixos in case that user has set nodePackages to a different version than nodePackages_10_x. The package attribute npm is not part of any other nodePackages version than version 10. This commit makes sure nixos may be build by users who st their nodePackages to a different version and do not want to have programs npm enabled.
Motivation for this change
programs.npm.
nixos config.cc @cillianderoiste @gilligan @cko
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)