Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

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

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Nix
  3. npmlock2nix

npmlock2nix

Apache-2.0Nix

A Nix library that converts npm-based packages into reproducible Nix derivations by parsing package.json and package-lock.json.

GitHubGitHub
147 stars46 forks0 contributors

What is npmlock2nix?

npmlock2nix is a Nix library that converts npm-based JavaScript projects into Nix derivations by parsing package.json and package-lock.json files. It solves the problem of integrating Node.js dependencies into the Nix ecosystem, enabling reproducible and pure builds for npm packages.

Target Audience

Nix users and developers who need to manage npm-based projects within Nix workflows, such as those building JavaScript applications or tools with Nix.

Value Proposition

Developers choose npmlock2nix for its simplicity, reliability, and adherence to Nix principles, offering a tested and unit-tested solution that works in restricted evaluation and supports GitHub dependencies without auto-generated code.

Overview

nixify npm based packages [maintainer=@andir]

Use Cases

Best For

  • Integrating npm packages into Nix-based development environments
  • Creating reproducible builds for Node.js applications with Nix
  • Managing JavaScript dependencies in pure Nix derivations
  • Setting up development shells with node_modules for npm projects
  • Building npm-based projects with custom build commands in Nix
  • Handling GitHub-hosted dependencies in Nix workflows

Not Ideal For

  • Projects using yarn or pnpm without a package-lock.json file
  • Teams wanting a zero-configuration, drop-in solution for npm builds
  • Developers not already familiar with Nix overlays and derivations

Pros & Cons

Pros

Pure Nix Implementation

Uses pure Nix expressions without auto-generated code, ensuring better integration and reliability within Nix workflows, as emphasized in the features.

Secure Evaluation Support

Works in Nix's restricted evaluation mode, enhancing security for builds in controlled environments, a key feature highlighted in the README.

GitHub Dependency Handling

Supports dependencies hosted directly on GitHub, extending beyond standard npm registries for more flexible source management.

Comprehensive Testing Suite

Includes both unit and integration tests, ensuring robustness and reliability for production use, as noted in the features and development section.

Cons

Manual Build Configuration

Requires users to explicitly define buildCommands and installPhase for custom builds, adding complexity compared to more automated tools.

Lock File Reliance

Depends solely on package-lock.json, making it incompatible with projects using yarn.lock or pnpm-lock.yaml without manual conversion or additional steps.

Nix Ecosystem Dependency

Only useful within Nix-based workflows, requiring setup with niv and overlays, which can be a barrier for teams not invested in Nix.

Frequently Asked Questions

Quick Stats

Stars147
Forks46
Contributors0
Open Issues37
Last commit11 months ago
CreatedSince 2020

Tags

#lockfile#npm#development-environment#nodejs#nix#package-management#javascript#nix-library#reproducible-builds

Built With

N
Nix

Included in

Nix5.0k
Auto-fetched 11 hours ago

Related Projects

node2nixnode2nix

Generate Nix expressions to build NPM packages

Stars591
Forks99
Last commit1 year 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