Deploying NPM packages with the Nix package manager
Channel: FOSDEM
Date: 2018-03-10

by Sander van der Burg

At: FOSDEM 2017

Nix is a package manager providing a number of unique features to automatedeployments in a reliable and reproducible way. It serves as the basis of theNixOS Linux distribution (that can be automatically installed from a singledeclarative specification), as well as a number of additional deploymentsolutions, such as NixOps, that deploys virtual machines in the cloud andHydra: the Nix-based continuous integration server. Although Nix offers allkinds of deployment benefits, integration with language-specific packagemanagers that also do dependency management, such as the NPM package manager,is problematic as they conflict with Nix's reliability properties. In thispresentation, I will show `node2nix`, a tool that automatically generates Nixexpressions (build recipes) from an NPM package's `package.json` configurationfile, allowing users to deploy NPM packages with the Nix package mangeralongside other types of packages (e.g. Autotools, Perl, Python, ...) thatconstitute a large complex system.

In this talk I try to address the following target audience:

  * System administrators/DevOps:     * people who typically deploy entire software systems in which parts of them might be Node.js applications    * NPM makes it less convenient to use a single intergrated deployment solution, e.g. you might need to use both NPM and the host system's package manager + additional scripts    * solution requires on external distribution channels  * Distro packagers:     * Some types of software are hard to package and as a result difficult to include with e.g. a Linux distribution    * Especially if source package uses a system that does both build and dependency management    * The Dependency manager conflicts with the host system's package manager and might use inferior technology    * Besides NPM, Apache Maven is also a prominent example  * Node.js developers:     * Many Node developers are not aware of some of NPM's dependency management implications    * Good to raise awareness  * Package manager developers (e.g. the NPM devs):     * Virtually every modern programming language/environment has its own (language-specific) package manager    * Lessons learned are important for everybody


Room: K.4.601
Scheduled start: 2017-02-04 15:30:00