Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Nix
  3. node2nix

node2nix

MITNixnode2nix-1.11.0

Generate Nix expressions to build and deploy NPM packages using the Nix package manager.

GitHubGitHub
590 stars99 forks0 contributors

What is node2nix?

node2nix is a tool that generates Nix expressions from NPM package configurations, allowing Node.js projects and dependencies to be built and deployed using the Nix package manager. It solves the problem of integrating NPM's dependency management with Nix's reproducible and declarative packaging system, enabling consistent builds across environments.

Target Audience

Developers and system administrators using Nix or NixOS who need to manage Node.js applications, packages, or development environments within the Nix ecosystem.

Value Proposition

node2nix provides a reliable way to bring NPM packages into Nix, offering reproducibility, integration with NixOS and other Nix tools, and advanced customization options like dependency overrides and lock file support, which are not available with vanilla NPM.

Overview

Generate Nix expressions to build NPM packages

Use Cases

Best For

  • Deploying Node.js projects on NixOS with Nix
  • Managing Node.js dependencies reproducibly across teams
  • Integrating Node.js applications into NixOps or Disnix deployments
  • Building Node.js packages with custom native dependencies
  • Using NPM lock files to pin exact dependency versions in Nix
  • Creating development environments for Node.js projects with Nix shell

Not Ideal For

  • Teams using Docker or Kubernetes for containerized deployments without Nix
  • Developers wanting a simple npm install workflow without Nix expression management
  • Projects with rapidly changing dependencies where frequent regeneration of Nix expressions is impractical
  • Environments where Nix is not installed or supported, such as some cloud CI/CD services

Pros & Cons

Pros

Lock File Compatibility

Integrates package-lock.json to pin exact dependency versions in Nix builds, ensuring consistency with NPM and reproducible deployments as highlighted in the 'Using NPM lock files' section.

Nix Ecosystem Integration

Seamlessly works with NixOS, NixOps, and Disnix for system-wide and service-oriented deployments, enabling unified management of Node.js applications within Nix workflows.

Advanced Customization Options

Supports dependency overrides, native library injections, and executable wrapping through Nix's override mechanism, detailed in the 'Advanced options' section for handling complex cases.

Multi-Node.js Version Support

Generates tailored expressions for specific Node.js versions, accommodating different flattening and caching behaviors, as shown with the -4 flag for Node.js 4.x compatibility.

Cons

Complex Troubleshooting Overhead

The README includes a dedicated troubleshooting section for issues like peer dependencies and optional dependencies, often requiring manual fixes or workarounds that add maintenance burden.

Nix Expertise Required

Demands proficiency in Nix and Nix expressions to use effectively, making it inaccessible for teams not already invested in the Nix ecosystem, as evidenced by the need for custom override files.

Brittle with Dependency Changes

Deployments can fail if package.json changes without updating lock files, and the README notes the need to disable npm install or use overrides to resolve mismatches, indicating fragility.

Frequently Asked Questions

Quick Stats

Stars590
Forks99
Contributors0
Open Issues119
Last commit1 year ago
CreatedSince 2014

Tags

#npm#dependency-management#nodejs#nixos#nix#package-management#javascript#build-tool#reproducible-builds

Built With

J
JavaScript
N
Node.js

Included in

Nix5.0k
Auto-fetched 8 hours ago

Related Projects

npmlock2nixnpmlock2nix

nixify npm based packages [maintainer=@andir]

Stars148
Forks46
Last commit10 months ago
NapalmNapalm

Support for building npm packages in Nix and lightweight npm registry [maintainer=?]

Stars117
Forks17
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub