-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add node program configuration #684
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ let | |
| lazygit = import ./lazygit; | ||
| lsd = import ./lsd; | ||
| neovim = import ./neovim; | ||
| node = import ./node; | ||
|
||
| python = import ./python; | ||
| rust = import ./rust; | ||
| ssh = import ./ssh; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,6 @@ | ||||||||||||||
| { pkgs, ... }: | ||||||||||||||
| { | ||||||||||||||
| home.packages = with pkgs; [ | ||||||||||||||
| node | ||||||||||||||
|
||||||||||||||
| node | |
| nodejs |
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.
Wrong package name: node should be nodejs
High Severity
The package is specified as node but the correct nixpkgs package name for Node.js is nodejs. Using pkgs.node will fail to build because this package doesn't exist in nixpkgs. The package reference needs to be nodejs (or a versioned variant like nodejs_20).
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.
P0: Incorrect package name: node does not exist in nixpkgs. The correct package name for Node.js is nodejs. This will cause a build failure.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At home-manager/programs/node/default.nix, line 4:
<comment>Incorrect package name: `node` does not exist in nixpkgs. The correct package name for Node.js is `nodejs`. This will cause a build failure.</comment>
<file context>
@@ -0,0 +1,6 @@
+{ pkgs, ... }:
+{
+ home.packages = with pkgs; [
+ node
+ ];
+}
</file context>
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.
🧩 Analysis chain
🏁 Script executed:
# First, let's check the actual file content
cat -n home-manager/programs/node/default.nixRepository: shunkakinoki/dotfiles
Length of output: 170
🏁 Script executed:
# Verify nixpkgs packages - check if both 'node' and 'nodejs' exist
# and what they point to
rg -i "node" --type nix | head -20Repository: shunkakinoki/dotfiles
Length of output: 1698
🌐 Web query:
home-manager nodejs programs module
💡 Result:
Home Manager does not have a programs.nodejs module; for Node.js you typically just install a Node package via home.packages, and (optionally) manage npm configuration via programs.npm.*. Home Manager program modules usually live under programs.<name>, but many tools (like Node.js) are just installed as packages instead. [4]
Example (home.nix)
{ pkgs, ... }:
{
home.packages = [
pkgs.nodejs_24 # or pkgs.nodejs, pkgs.nodejs_22, etc.
];
programs.npm = {
enable = true; # manage ~/.npmrc [3]
package = pkgs.nodejs_24; # which nodejs provides npm [1]
settings = {
prefix = "${HOME}/.npm"; # default, example override [2]
};
};
}If your goal is just “install Node”, home.packages = [ pkgs.nodejs_<version> ]; is the key piece. [4]
🌐 Web query:
nixpkgs nodejs node package name
💡 Result:
In nixpkgs, Node-related packages typically show up under these attribute names:
-
Node.js runtime
nodejs= alias for the latest LTS Node.js in nixpkgs (manually updated in nixpkgs). [2]- Versioned runtimes are named like
nodejs_20,nodejs_24, etc. (andnodejs_latesttracks the latest “current” release; e.g., release notes mentionnodejs_latestmoving to 24.x andnodejs_24existing). [1][3] - Discover exact names on your channel with:
nix search nixpkgs nodejs. [2]
-
npm “end-user” CLI tools packaged in nixpkgs
- These are in the generated set
nodePackages(and a “current” variantnodePackages_latest). [3] - Naming:
- Unscoped:
nodePackages.<name>(example:nodePackages.typescript) - Scoped npm names use quotes:
nodePackages."@scope/name"(example from release notes:nodePackages."@commitlint/config-conventional"). [1]
- Unscoped:
- These are in the generated set
If you tell me the exact npm package name (e.g. eslint, @angular/cli, etc.), I can tell you the most likely nixpkgs attribute and a nix search command to confirm it.
Incorrect package name: node should be nodejs.
In nixpkgs, the Node.js package is named nodejs, not node. Using node will cause a build failure because this attribute does not exist in nixpkgs.
Proposed fix
home.packages = with pkgs; [
- node
+ nodejs
];📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| home.packages = with pkgs; [ | |
| node | |
| ]; | |
| home.packages = with pkgs; [ | |
| nodejs | |
| ]; |
🤖 Prompt for AI Agents
In `@home-manager/programs/node/default.nix` around lines 3 - 5, Replace the
incorrect package attribute name in the home.packages list: change the reference
to node to the correct nixpkgs attribute nodejs so home.packages = with pkgs; [
nodejs ]; ensuring the Node.js package resolves properly during evaluation.
Copilot
AI
Jan 29, 2026
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.
This module may conflict with or be redundant to the existing fnm (Fast Node Manager) module at home-manager/programs/fnm/default.nix, which already manages Node.js installation through version management. Consider whether this module is needed, or if it should be used as an alternative to fnm for users who prefer a direct Node.js installation. If both modules are meant to coexist, add documentation explaining when to use each approach.
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.
Redundant Node.js module duplicates fnm functionality
Low Severity
The new node module adds Node.js directly via home.packages, but the existing fnm module already provides comprehensive Node.js management. The fnm module pre-installs Node.js versions 22 and 20, sets up version switching, and creates symlinks. Having both modules enabled would result in redundant installations and potential confusion about which Node.js is being used.
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.
The
nodemodule is correctly imported here. However, for the configuration to be applied, you also need to addnodeto the list of enabled programs in theinblock further down in this file (around lines 37-65). Without this, the Node.js configuration will not be active.