SlideShare a Scribd company logo
1 of 51
Download to read offline
Deploying NPM packages with the Nix package
manager
Sander van der Burg
Feb 4, 2017
Sander van der Burg Deploying NPM packages with the Nix package manager
The Nix project
Family of declarative software deployment tools:
Nix. A purely functional package manager
NixOS. Nix based GNU/Linux distribution
Hydra. Nix based continuous build and integration server
Disnix. Nix based distributed service deployment
NixOps. NixOS-based multi-cloud deployment tool
Sander van der Burg Deploying NPM packages with the Nix package manager
The Nix project
Non-functional properties:
Generic. Can be used with many programming languages,
component technologies, and operating systems.
Reproducible. (Almost) no impurities – if inputs are the same,
result should be the same.
Reliable. Dependency completeness, (almost) atomic
upgrades and rollbacks.
Efficient. Only the required deployment activities are
executed.
Sander van der Burg Deploying NPM packages with the Nix package manager
NixOS configuration
/etc/nixos/configuration.nix
{pkgs, ...}:
{
boot.loader.grub.device = "/dev/sda";
fileSystems = [ { mountPoint = "/"; device = "/dev/sda2"; } ];
swapDevices = [ { device = "/dev/sda1"; } ];
services = {
openssh.enable = true;
xserver = {
enable = true;
desktopManager.kde4.enable = true;
};
};
environment.systemPackages = [ pkgs.mc pkgs.firefox ];
}
Sander van der Burg Deploying NPM packages with the Nix package manager
NixOS configuration
nixos-rebuild switch
Nix package manager builds a complete system configuration
Includes all packages and generates all configuration files, e.g.
OpenSSH configuration
Upgrades are (almost) atomic
Components are stored safely next to each other, due to hashes
No files are automatically removed or overwritten
Users can switch to older generations of system configurations
not garbage collected yet
Sander van der Burg Deploying NPM packages with the Nix package manager
NixOS bootloader
Sander van der Burg Deploying NPM packages with the Nix package manager
The Nix project
Basis of all tools: The Nix package manager
Sander van der Burg Deploying NPM packages with the Nix package manager
Nix store
Main idea: store all packages
in isolation from each other:
/nix/store/rpdqxnilb0cg...
-firefox-3.5.4
Paths contain a 160-bit
cryptographic hash of all
inputs used to build the
package:
Sources
Libraries
Compilers
Build scripts
. . .
/nix/store
l9w6773m1msy...-openssh-4.6p1
bin
ssh
sbin
sshd
smkabrbibqv7...-openssl-0.9.8e
lib
libssl.so.0.9.8
c6jbqm2mc0a7...-zlib-1.2.3
lib
libz.so.1.2.3
im276akmsrhv...-glibc-2.5
lib
libc.so.6
Sander van der Burg Deploying NPM packages with the Nix package manager
Nix expressions
openssh.nix
{ stdenv, fetchurl, openssl, zlib }:
stdenv.mkDerivation {
name = "openssh-4.6p1";
src = fetchurl {
url = http://.../openssh-4.6p1.tar.gz;
sha256 = "0fpjlr3bfind0y94bk442x2p...";
};
buildCommand = ’’
tar xjf $src
./configure --prefix=$out --with-openssl=${openssl}
make; make install
’’;
}
Sander van der Burg Deploying NPM packages with the Nix package manager
Nix expressions
all-packages.nix
openssh = import ../tools/networking/openssh {
inherit fetchurl stdenv openssl zlib;
};
openssl = import ../development/libraries/openssl {
inherit fetchurl stdenv perl;
};
stdenv = ...;
openssl = ...;
zlib = ...;
perl = ...;
nix-env -f all-packages.nix -iA openssh
Produces a /nix/store/l9w6773m1msy...-openssh-4.6p1
package in the Nix store.
Sander van der Burg Deploying NPM packages with the Nix package manager
User environments
Users can have
different sets of
installed applications.
PATH
/nix/.../profiles
current
42
/nix/store
pp56i0a01si5...-user-env
bin
firefox
ssh
l9w6773m1msy...-openssh-4.6p1
bin
ssh
rpdqxnilb0cg...-firefox-3.5.4
bin
firefox
Sander van der Burg Deploying NPM packages with the Nix package manager
User environments
Users can have
different sets of
installed applications.
nix-env operations
create new user
environments in the
store.
PATH
/nix/.../profiles
current
42
/nix/store
pp56i0a01si5...-user-env
bin
firefox
ssh
l9w6773m1msy...-openssh-4.6p1
bin
ssh
rpdqxnilb0cg...-firefox-3.5.4
bin
firefox
aqn3wygq9jzk...-openssh-5.2p1
bin
ssh
(nix-env -u openssh)
Sander van der Burg Deploying NPM packages with the Nix package manager
User environments
Users can have
different sets of
installed applications.
nix-env operations
create new user
environments in the
store.
PATH
/nix/.../profiles
current
42
/nix/store
pp56i0a01si5...-user-env
bin
firefox
ssh
l9w6773m1msy...-openssh-4.6p1
bin
ssh
rpdqxnilb0cg...-firefox-3.5.4
bin
firefox
aqn3wygq9jzk...-openssh-5.2p1
bin
ssh
i3d9vh6d8ip1...-user-env
bin
ssh
firefox
(nix-env -u openssh)
Sander van der Burg Deploying NPM packages with the Nix package manager
User environments
Users can have
different sets of
installed applications.
nix-env operations
create new user
environments in the
store.
PATH
/nix/.../profiles
current
42
43
/nix/store
pp56i0a01si5...-user-env
bin
firefox
ssh
l9w6773m1msy...-openssh-4.6p1
bin
ssh
rpdqxnilb0cg...-firefox-3.5.4
bin
firefox
aqn3wygq9jzk...-openssh-5.2p1
bin
ssh
i3d9vh6d8ip1...-user-env
bin
ssh
firefox
(nix-env -u openssh)
Sander van der Burg Deploying NPM packages with the Nix package manager
User environments
Users can have
different sets of
installed applications.
nix-env operations
create new user
environments in the
store.
We can atomically
switch between them.
PATH
/nix/.../profiles
current
42
43
/nix/store
pp56i0a01si5...-user-env
bin
firefox
ssh
l9w6773m1msy...-openssh-4.6p1
bin
ssh
rpdqxnilb0cg...-firefox-3.5.4
bin
firefox
aqn3wygq9jzk...-openssh-5.2p1
bin
ssh
i3d9vh6d8ip1...-user-env
bin
ssh
firefox
(nix-env -u openssh)
Sander van der Burg Deploying NPM packages with the Nix package manager
User environments
Users can have
different sets of
installed applications.
nix-env operations
create new user
environments in the
store.
We can atomically
switch between them.
These are roots of the
garbage collector.
PATH
/nix/.../profiles
current
43
/nix/store
pp56i0a01si5...-user-env
bin
firefox
ssh
l9w6773m1msy...-openssh-4.6p1
bin
ssh
rpdqxnilb0cg...-firefox-3.5.4
bin
firefox
aqn3wygq9jzk...-openssh-5.2p1
bin
ssh
i3d9vh6d8ip1...-user-env
bin
ssh
firefox
(nix-env --remove-generations old)
Sander van der Burg Deploying NPM packages with the Nix package manager
User environments
Users can have
different sets of
installed applications.
nix-env operations
create new user
environments in the
store.
We can atomically
switch between them.
These are roots of the
garbage collector.
PATH
/nix/.../profiles
current
43
/nix/store
rpdqxnilb0cg...-firefox-3.5.4
bin
firefox
aqn3wygq9jzk...-openssh-5.2p1
bin
ssh
i3d9vh6d8ip1...-user-env
bin
ssh
firefox
(nix-collect-garbage)
Sander van der Burg Deploying NPM packages with the Nix package manager
Nix expressions
openssh.nix
{ stdenv, fetchurl, openssl, zlib }:
stdenv.mkDerivation {
name = "openssh-4.6p1";
src = fetchurl {
url = http://.../openssh-4.6p1.tar.gz;
sha256 = "0fpjlr3bfind0y94bk442x2p...";
};
buildCommand = ’’
tar xjf $src
./configure --prefix=$out --with-openssl=${openssl}
make; make install
’’;
}
Nix complements existing build tools with a pure environment
You can also run other build tools in an environment, e.g.
cmake, ant, scons
Sander van der Burg Deploying NPM packages with the Nix package manager
Pure environments
Precautions in service of making build results bit-identical
(regardless on what machine the package has been built):
Clearing (most) environment variables or setting them to
dummy values
Modifying search environment variables to contain Nix store
paths to only specified dependencies (e.g. PATH, PYTHONPATH,
CLASSPATH, PERL5LIB)
Using designated temp folders and output folders
Making packages immutable by making their files read-only
Resetting timestamps to 1
Chroot environments/namespaces
Restricting network access
Sander van der Burg Deploying NPM packages with the Nix package manager
What about Node.js/NPM projects?
NPM is Node.js’ ubiquitous deployment tool.
NPM also does dependency management in addition to build
management
NPM’s dependency management conflicts with Nix’s
dependency management
Sander van der Burg Deploying NPM packages with the Nix package manager
package.json configuration
{
"name" :"nijs",
"version" :"0.0.23",
"description" :"An internal DSL for the Nix package manager in JavaScript",
"repository" :{
"type" :"git",
"url" :"https://github.com/svanderburg/nijs.git"
},
"author" :"Sander van der Burg",
"license" :"MIT",
"main" :"./lib/nijs",
"dependencies" :{
"optparse" :">= 1.0.3",
"slasp": "0.0.4"
}
}
$ npm install
$ ls node modules/
optparse slasp
Sander van der Burg Deploying NPM packages with the Nix package manager
Dealing with a conflicting dependency manager
Solution: substitute the conflicting dependency manager by
providing the dependencies with Nix first!
Sander van der Burg Deploying NPM packages with the Nix package manager
Solution: substitute NPM’s dependency management
{ stdenv, fetchgit, nodejs, optparse, slasp }:
let
nodeSources = ...
in
stdenv.mkDerivation {
name = "nijs-0.0.23";
src = fetchgit {
src = https://github.com/svanderburg/nijs.git;
rev = "...";
sha256 = "...";
};
buildInputs = [ nodejs ];
buildCommand = ’’
# Compose node_modules/ folder from the dependencies
...
# Perform the build by running npm install
# Since a node_modules/ folder with the dependencies already exists,
# NPM will not obtain them
npm --registry http://www.example.com --nodedir=${nodeSources} install
’’;
}
Sander van der Burg Deploying NPM packages with the Nix package manager
Solution: substitute NPM’s dependency management
{ stdenv, fetchgit, nodejs, optparse, slasp }:
let
nodeSources = ...
in
stdenv.mkDerivation {
name = "nijs-0.0.23";
src = fetchgit {
src = https://github.com/svanderburg/nijs.git;
rev = "...";
sha256 = "...";
};
buildInputs = [ nodejs ];
buildCommand = ’’
# Compose node_modules/ folder from the dependencies
...
# Perform the build by running npm install
# Since a node_modules/ folder with the dependencies already exists,
# NPM will not obtain them
npm --registry http://www.example.com --nodedir=${nodeSources} install
’’;
}
Sander van der Burg Deploying NPM packages with the Nix package manager
Substituting dependencies
We may be able to automatically generate a Nix expression
from a package.json file since they capture similar proper-
ties!
Solution: substitute NPM’s dependency management
{ stdenv, fetchgit, nodejs, optparse, slasp }:
let
nodeSources = ...
in
stdenv.mkDerivation {
name = "nijs-0.0.23";
src = fetchgit {
src = https://github.com/svanderburg/nijs.git;
rev = "...";
sha256 = "...";
};;
buildInputs = [ nodejs ];
buildCommand = ’’
# Compose node_modules/ folder from the dependencies
...
# Perform the build by running npm install
# Since a node_modules/ folder with the dependencies already exists,
# NPM will not obtain them
npm --registry http://www.example.com --nodedir=${nodeSources} install
’’;
}
Sander van der Burg Deploying NPM packages with the Nix package manager
Substituting dependencies
Appears to be straight forward! Is it really that straight
forward?
Generating Nix expressions
It is actually much more complicated!
Sander van der Burg Deploying NPM packages with the Nix package manager
NPM dependency classes
Dependencies:
Run-time dependencies of a package
Development dependencies:
Build-time dependencies, e.g. transpilers
Should only be installed if they have been requested
Peer dependencies:
Check whether a shared dependency does not conflict.
In old versions of NPM, missing peer dependencies were also
installed.
Bundled dependencies:
Statically bundled with a package. No need to install.
Optional dependencies:
Dependencies that are allowed to break.
Typically used to bundle platform-specific code.
Permitting errors (especially non-deterministic ones)
incompatible with Nix deployment model
Sander van der Burg Deploying NPM packages with the Nix package manager
NPM dependency classes
Dependencies:
Run-time dependencies of a package
Development dependencies:
Build-time dependencies, e.g. transpilers
Should only be installed if they have been requested
Peer dependencies:
Check whether a shared dependency does not conflict.
In old versions of NPM, missing peer dependencies were also
installed.
Bundled dependencies:
Statically bundled with a package. No need to install.
Optional dependencies:
Dependencies that are allowed to break.
Typically used to bundle platform-specific code.
Permitting errors (especially non-deterministic ones)
incompatible with Nix deployment model
Sander van der Burg Deploying NPM packages with the Nix package manager
Interpreting dependency classes
We only need to consider dependencies and development de-
pendencies (if they are requested) and substract the bundled
dependencies
Version specifiers: NPM registry
NPM version specifiers are nominal and semantically versioned:
Precise version numbers: e.g. 1.0.0, 2.1.1
Version ranges and wildcards: e.g. 1.0.x, *, >= 1.0.1
Tags: latest, beta
The above version specifiers refer to packages obtained from the
NPM registry.
Sander van der Burg Deploying NPM packages with the Nix package manager
Version specifiers: external packages
Local filesystem paths, e.g. /home/sander/nijs
External URLs, e.g.
http://example.com/packages/nijs-0.0.23.tgz
Git URLs, e.g.
https://github.com/svanderburg/nijs.git
GitHub, BitBucket, GitLab, e.g. github:svanderburg/nijs
Above specifiers obtain packages from other sources than the
registry. They indirectly resolve to a package with a name and
version number.
Sander van der Burg Deploying NPM packages with the Nix package manager
Version specifiers: translation to Nix
Nix version specifiers are exact (any point of variation is reflected
in the hash prefix):
/nix/store/rpdqxnilb0cg...-firefox-3.5.4
Sander van der Burg Deploying NPM packages with the Nix package manager
Version specifiers: translation to Nix
Nix version specifiers are exact (any point of variation is reflected
in the hash prefix):
/nix/store/rpdqxnilb0cg...-firefox-3.5.4
To make a translation from NPM version specifiers to exact
version specifiers:
We must snapshot a version range and pinpoint the resolved
version (version ranges are unsupported in Nix)
We must supply the output hash to make it deterministic:
src = fetchurl {
url = "https://registry.npmjs.org/nijs/-/nijs-0.0.23.tgz";
sha1 = "dbf8f4a0acafbe3b8d9b71c24cbd1d851de6c31a";
};
Sander van der Burg Deploying NPM packages with the Nix package manager
Private, shared and cyclic dependencies
When including a package as a CommonJS module:
./node2nix/node modules/nijs/lib/execute/index.js
var slasp = require(’slasp’);
The module loader searches recursively upwards in node modules/
sub folders for the corresponding package:
./node2nix/nijs/node_modules/slasp
./node2nix/node_modules/slasp
./node_modules/slasp
Sander van der Burg Deploying NPM packages with the Nix package manager
Private, shared and cyclic dependencies
Private dependency: a package residing in a package’s
node modules/ sub folder.
Shared dependency: a package residing in a parent directory’s
node modules/ sub folder.
Sander van der Burg Deploying NPM packages with the Nix package manager
Private, shared and cyclic dependencies
When installing dependencies with NPM, NPM will not install a
dependency privately if a conforming shared dependency exists.
Some undesired implications:
A version range does not always yield the latest version that
fits in a version range.
Cyclic dependencies are permitted. Bad practice, as packages
are supposed to be units of reuse.
Sander van der Burg Deploying NPM packages with the Nix package manager
Flat-module installations
npm < 3.x installs dependencies privately by default (unless a
conforming dependency exists in any parent node modules/
folder):
webapp/
...
package.json
node_modules/
express/
...
package.json
node_modules/
accepts/
array-flatten/
content-disposition/
...
ejs/
...
package.json
Sander van der Burg Deploying NPM packages with the Nix package manager
Flat-module installations
npm ≥ 3.x implements flat-module installations (moving packages
as high as possible in the node modules/ hierarchy):
webapp/
...
package.json
node_modules/
accepts/
array-flatten/
content-disposition/
express/
...
package.json
ejs/
...
package.json
Because no packages conflict, they all appear in the top level
node modules/ folder. Implications:
Shorter path names, some degree of deduplication
The order in which packages are installed matters
Sander van der Burg Deploying NPM packages with the Nix package manager
Simulating flat-module installations
We cannot build each NPM dependency as a Nix package, with a
separate store path:
CommonJS module resolves its own symlink location. Some
relative paths may not work:
var slasp = require(’../slasp’);
Flattening the module hierarchy is imperative.
Nix packages are made immutable after they have been built.
Solution: compose the entire dependency tree statically ahead of
time in one Nix package
Sander van der Burg Deploying NPM packages with the Nix package manager
Replacing impure version specifiers
Some version specifiers (e.g. tags and Git URLs), trigger NPM to
always check the remote locations for changes in each npm
install run:
Replace these version specifiers by: ’*’. Downside: it
sometimes confuses NPM, in particular flat module
installations.
Better solution: create fake processes (e.g git) giving a
deterministic result. This is still an open issue.
Sander van der Burg Deploying NPM packages with the Nix package manager
The solution1
: node2nix
1
Sort of, but not entirely :-)
Sander van der Burg Deploying NPM packages with the Nix package manager
Example: using node2nix on project-level
Generating Nix expressions from a package.json file:
$ node2nix
Building the project as a Nix package:
$ nix-build -A package
./result/bin/node2nix --help
Opening a development shell:
$ nix-shell -A shell
$ node bin/node2nix.js --help
Sander van der Burg Deploying NPM packages with the Nix package manager
Example: using node2nix on a package set
custom-packages.json
[
"node2nix"
,"bower"
,{"nijs": "https://github.com/svanderburg/nijs.git" }
,{"grunt-cli": "1.2.0" }
]
Generating Nix expressions:
$ node2nix -i custom-packages.json
Installing an NPM package with Nix:
$ nix-env -f default.nix -iA node2nix
$ node2nix --help
Sander van der Burg Deploying NPM packages with the Nix package manager
Example: simulating global dependencies
Global packages do not exist in Nix build environments. This is
problematic for certain kinds of projects, such as Grunt projects,
requiring the grunt-cli to be installed globally:
package.json
{
"name": "grunt-test",
"version": "0.0.1",
"private": "true",
"devDependencies": {
"grunt": "*",
"grunt-contrib-jshint": "*",
"grunt-contrib-watch": "*"
}
}
$ npm install
$ grunt build
Sander van der Burg Deploying NPM packages with the Nix package manager
Example: simulating global dependencies
We can supply global packages as extra packages:
supplement.json
[
"grunt-cli"
]
And generate the expressions as follows:
$ node2nix -d -i package.json 
--supplement-input supplement.json
Sander van der Burg Deploying NPM packages with the Nix package manager
Example: simulating global dependencies
override.nix
{ pkgs ? import <nixpkgs> {}
, system ? builtins.currentSystem
}:
let
nodePackages = import ./default.nix {
inherit pkgs system;
};
in
nodePackages // {
package = nodePackages.package.override {
postInstall = "grunt";
};
}
$ nix-build override.nix
Sander van der Burg Deploying NPM packages with the Nix package manager
Conclusion
I have explained Nix and NPM’s deployment concepts
I have described node2nix generating Nix expressions from
package.json configurations, making it possible to deploy
NPM packages with the Nix package manager.
Besides the package manager, it also becomes possible to
deploy entire systems using Node.js with NixOps and Disnix.
Sander van der Burg Deploying NPM packages with the Nix package manager
Lessons
Naming packages: a name and version number typically does
not suffice!
Nix uses hash codes derived from all build inputs
.NET global assembly cache: strong names
Organization: isolate dependencies
Cyclic dependencies: disallow them – packages are supposed
to be units of reuse
Sander van der Burg Deploying NPM packages with the Nix package manager
Related work: other generators
npm2nix: Original generation attempt done by Shea Levy.
Composes Nix store paths for each dependency and symlinks
them.
Faster, but less accurate when dealing when shared
dependencies
Does not support flat module installations or cyclic
dependencies
nixfromnpm: Implementation of npm2nix’s Nix concepts in
Haskell. Can partially regenerate expressions.
Sander van der Burg Deploying NPM packages with the Nix package manager
Related work: NPM alternatives
yarn: parallelization for speed improvements, version locking
ied: parallelization, content-addressable store, atomicity,
maximal sharing of dependencies (some of its concepts are
heavily inspired by Nix according to its author :-) )
Sander van der Burg Deploying NPM packages with the Nix package manager
References
Nix project: http://nixos.org.
Nix package manager: http://nixos.org/nix.
node2nix: https://github.com/svanderburg/node2nix.
Sander van der Burg Deploying NPM packages with the Nix package manager
Questions
Sander van der Burg Deploying NPM packages with the Nix package manager

More Related Content

What's hot

Hydra: Continuous Integration and Testing for Demanding People: The Details
Hydra: Continuous Integration and Testing for Demanding People: The DetailsHydra: Continuous Integration and Testing for Demanding People: The Details
Hydra: Continuous Integration and Testing for Demanding People: The DetailsSander van der Burg
 
Docker: the road ahead
Docker: the road aheadDocker: the road ahead
Docker: the road aheadshykes
 
Docker 原理與實作
Docker 原理與實作Docker 原理與實作
Docker 原理與實作kao kuo-tung
 
Hydra: Continuous Integration and Testing for Demanding People: The Basics
Hydra: Continuous Integration and Testing for Demanding People: The BasicsHydra: Continuous Integration and Testing for Demanding People: The Basics
Hydra: Continuous Integration and Testing for Demanding People: The BasicsSander van der Burg
 
Docker Security: Are Your Containers Tightly Secured to the Ship?
Docker Security: Are Your Containers Tightly Secured to the Ship?Docker Security: Are Your Containers Tightly Secured to the Ship?
Docker Security: Are Your Containers Tightly Secured to the Ship?Michael Boelen
 
"Containers do not contain"
"Containers do not contain""Containers do not contain"
"Containers do not contain"Maciej Lasyk
 
[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020Akihiro Suda
 
Rootless Containers & Unresolved issues
Rootless Containers & Unresolved issuesRootless Containers & Unresolved issues
Rootless Containers & Unresolved issuesAkihiro Suda
 
Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017Chris Tankersley
 
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...Akihiro Suda
 
A Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things ContainersA Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things ContainersJérôme Petazzoni
 
Nomad, l'orchestration made in Hashicorp - Bastien Cadiot
Nomad, l'orchestration made in Hashicorp - Bastien CadiotNomad, l'orchestration made in Hashicorp - Bastien Cadiot
Nomad, l'orchestration made in Hashicorp - Bastien CadiotParis Container Day
 
Тарас Кирилюк — Docker basics. How-to for Drupal developers
Тарас Кирилюк — Docker basics. How-to for Drupal developersТарас Кирилюк — Docker basics. How-to for Drupal developers
Тарас Кирилюк — Docker basics. How-to for Drupal developersLEDC 2016
 
Docker 101 @KACST Saudi HPC 2016
Docker 101  @KACST Saudi HPC 2016Docker 101  @KACST Saudi HPC 2016
Docker 101 @KACST Saudi HPC 2016Walid Shaari
 
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsI Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsMichael Lange
 
[KubeCon EU 2020] containerd Deep Dive
[KubeCon EU 2020] containerd Deep Dive[KubeCon EU 2020] containerd Deep Dive
[KubeCon EU 2020] containerd Deep DiveAkihiro Suda
 
[DockerCon 2019] Hardening Docker daemon with Rootless mode
[DockerCon 2019] Hardening Docker daemon with Rootless mode[DockerCon 2019] Hardening Docker daemon with Rootless mode
[DockerCon 2019] Hardening Docker daemon with Rootless modeAkihiro Suda
 
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKitAkihiro Suda
 

What's hot (20)

Hydra: Continuous Integration and Testing for Demanding People: The Details
Hydra: Continuous Integration and Testing for Demanding People: The DetailsHydra: Continuous Integration and Testing for Demanding People: The Details
Hydra: Continuous Integration and Testing for Demanding People: The Details
 
Docker: the road ahead
Docker: the road aheadDocker: the road ahead
Docker: the road ahead
 
Docker 原理與實作
Docker 原理與實作Docker 原理與實作
Docker 原理與實作
 
Hydra: Continuous Integration and Testing for Demanding People: The Basics
Hydra: Continuous Integration and Testing for Demanding People: The BasicsHydra: Continuous Integration and Testing for Demanding People: The Basics
Hydra: Continuous Integration and Testing for Demanding People: The Basics
 
Docker Security: Are Your Containers Tightly Secured to the Ship?
Docker Security: Are Your Containers Tightly Secured to the Ship?Docker Security: Are Your Containers Tightly Secured to the Ship?
Docker Security: Are Your Containers Tightly Secured to the Ship?
 
"Containers do not contain"
"Containers do not contain""Containers do not contain"
"Containers do not contain"
 
[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020
 
Rootless Containers & Unresolved issues
Rootless Containers & Unresolved issuesRootless Containers & Unresolved issues
Rootless Containers & Unresolved issues
 
Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017
 
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
 
A Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things ContainersA Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things Containers
 
Nomad, l'orchestration made in Hashicorp - Bastien Cadiot
Nomad, l'orchestration made in Hashicorp - Bastien CadiotNomad, l'orchestration made in Hashicorp - Bastien Cadiot
Nomad, l'orchestration made in Hashicorp - Bastien Cadiot
 
Ansible docker
Ansible dockerAnsible docker
Ansible docker
 
Тарас Кирилюк — Docker basics. How-to for Drupal developers
Тарас Кирилюк — Docker basics. How-to for Drupal developersТарас Кирилюк — Docker basics. How-to for Drupal developers
Тарас Кирилюк — Docker basics. How-to for Drupal developers
 
Docker 101 @KACST Saudi HPC 2016
Docker 101  @KACST Saudi HPC 2016Docker 101  @KACST Saudi HPC 2016
Docker 101 @KACST Saudi HPC 2016
 
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsI Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
 
Dokku
DokkuDokku
Dokku
 
[KubeCon EU 2020] containerd Deep Dive
[KubeCon EU 2020] containerd Deep Dive[KubeCon EU 2020] containerd Deep Dive
[KubeCon EU 2020] containerd Deep Dive
 
[DockerCon 2019] Hardening Docker daemon with Rootless mode
[DockerCon 2019] Hardening Docker daemon with Rootless mode[DockerCon 2019] Hardening Docker daemon with Rootless mode
[DockerCon 2019] Hardening Docker daemon with Rootless mode
 
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
 

Similar to Deploying NPM packages with the Nix package manager

A Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentA Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentSander van der Burg
 
Deploying .NET applications with the Nix package manager
Deploying .NET applications with the Nix package managerDeploying .NET applications with the Nix package manager
Deploying .NET applications with the Nix package managerSander van der Burg
 
Automating Mendix application deployments with Nix
Automating Mendix application deployments with NixAutomating Mendix application deployments with Nix
Automating Mendix application deployments with NixSander van der Burg
 
Techniques and lessons for improvement of deployment processes
Techniques and lessons for improvement of deployment processesTechniques and lessons for improvement of deployment processes
Techniques and lessons for improvement of deployment processesSander van der Burg
 
Building an Ionic hybrid mobile app with TypeScript
Building an Ionic hybrid mobile app with TypeScript Building an Ionic hybrid mobile app with TypeScript
Building an Ionic hybrid mobile app with TypeScript Serge van den Oever
 
An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)iFour Technolab Pvt. Ltd.
 
Introduction to OpenNMS
Introduction to OpenNMSIntroduction to OpenNMS
Introduction to OpenNMSPOSSCON
 
Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Susan Potter
 
CEPH DAY BERLIN - PRACTICAL CEPHFS AND NFS USING OPENSTACK MANILA
CEPH DAY BERLIN - PRACTICAL CEPHFS AND NFS USING OPENSTACK MANILACEPH DAY BERLIN - PRACTICAL CEPHFS AND NFS USING OPENSTACK MANILA
CEPH DAY BERLIN - PRACTICAL CEPHFS AND NFS USING OPENSTACK MANILACeph Community
 
Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...
Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...
Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...TomBarron
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and dockerFabio Fumarola
 
Steps to install ns3
Steps to install ns3Steps to install ns3
Steps to install ns3DIGITAL PADM
 
Binary Packaging for HPC with Spack
Binary Packaging for HPC with SpackBinary Packaging for HPC with Spack
Binary Packaging for HPC with Spackinside-BigData.com
 
Approaching package manager
Approaching package managerApproaching package manager
Approaching package managerTimur Safin
 
Docker containers : introduction
Docker containers : introductionDocker containers : introduction
Docker containers : introductionrinnocente
 
1 session installation
1 session installation1 session installation
1 session installationRahul Hada
 
Overview of Node JS
Overview of Node JSOverview of Node JS
Overview of Node JSJacob Nelson
 
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudPHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudSalesforce Developers
 
Anton Cherednikov "Modules and Artifacts in NPM"
Anton Cherednikov "Modules and Artifacts in NPM"Anton Cherednikov "Modules and Artifacts in NPM"
Anton Cherednikov "Modules and Artifacts in NPM"LogeekNightUkraine
 

Similar to Deploying NPM packages with the Nix package manager (20)

A Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentA Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software Deployment
 
Deploying .NET applications with the Nix package manager
Deploying .NET applications with the Nix package managerDeploying .NET applications with the Nix package manager
Deploying .NET applications with the Nix package manager
 
Automating Mendix application deployments with Nix
Automating Mendix application deployments with NixAutomating Mendix application deployments with Nix
Automating Mendix application deployments with Nix
 
Techniques and lessons for improvement of deployment processes
Techniques and lessons for improvement of deployment processesTechniques and lessons for improvement of deployment processes
Techniques and lessons for improvement of deployment processes
 
Building an Ionic hybrid mobile app with TypeScript
Building an Ionic hybrid mobile app with TypeScript Building an Ionic hybrid mobile app with TypeScript
Building an Ionic hybrid mobile app with TypeScript
 
An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)
 
Introduction to OpenNMS
Introduction to OpenNMSIntroduction to OpenNMS
Introduction to OpenNMS
 
Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)
 
CEPH DAY BERLIN - PRACTICAL CEPHFS AND NFS USING OPENSTACK MANILA
CEPH DAY BERLIN - PRACTICAL CEPHFS AND NFS USING OPENSTACK MANILACEPH DAY BERLIN - PRACTICAL CEPHFS AND NFS USING OPENSTACK MANILA
CEPH DAY BERLIN - PRACTICAL CEPHFS AND NFS USING OPENSTACK MANILA
 
Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...
Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...
Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and docker
 
Steps to install ns3
Steps to install ns3Steps to install ns3
Steps to install ns3
 
Binary Packaging for HPC with Spack
Binary Packaging for HPC with SpackBinary Packaging for HPC with Spack
Binary Packaging for HPC with Spack
 
Approaching package manager
Approaching package managerApproaching package manager
Approaching package manager
 
Docker containers : introduction
Docker containers : introductionDocker containers : introduction
Docker containers : introduction
 
1 session installation
1 session installation1 session installation
1 session installation
 
Overview of Node JS
Overview of Node JSOverview of Node JS
Overview of Node JS
 
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudPHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the Cloud
 
pkgsrc on MirBSD
pkgsrc on MirBSDpkgsrc on MirBSD
pkgsrc on MirBSD
 
Anton Cherednikov "Modules and Artifacts in NPM"
Anton Cherednikov "Modules and Artifacts in NPM"Anton Cherednikov "Modules and Artifacts in NPM"
Anton Cherednikov "Modules and Artifacts in NPM"
 

More from Sander van der Burg

Dysnomia: complementing Nix deployments with state deployment
Dysnomia: complementing Nix deployments with state deploymentDysnomia: complementing Nix deployments with state deployment
Dysnomia: complementing Nix deployments with state deploymentSander van der Burg
 
A Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentA Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentSander van der Burg
 
A Generic Approach for Deploying and Upgrading Mutable Software Components
A Generic Approach for Deploying and Upgrading Mutable Software ComponentsA Generic Approach for Deploying and Upgrading Mutable Software Components
A Generic Approach for Deploying and Upgrading Mutable Software ComponentsSander van der Burg
 
Deploying .NET services with Disnix
Deploying .NET services with DisnixDeploying .NET services with Disnix
Deploying .NET services with DisnixSander van der Burg
 
A Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented SystemsA Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented SystemsSander van der Burg
 
Disnix: A toolset for distributed deployment
Disnix: A toolset for distributed deploymentDisnix: A toolset for distributed deployment
Disnix: A toolset for distributed deploymentSander van der Burg
 
Automated Deployment of Hetergeneous Service-Oriented System
Automated Deployment of Hetergeneous Service-Oriented SystemAutomated Deployment of Hetergeneous Service-Oriented System
Automated Deployment of Hetergeneous Service-Oriented SystemSander van der Burg
 
Pull Deployment of Services: Introduction, Progress and Challenges
Pull Deployment of Services: Introduction, Progress and ChallengesPull Deployment of Services: Introduction, Progress and Challenges
Pull Deployment of Services: Introduction, Progress and ChallengesSander van der Burg
 
Software Deployment in a Dynamic Cloud
Software Deployment in a Dynamic CloudSoftware Deployment in a Dynamic Cloud
Software Deployment in a Dynamic CloudSander van der Burg
 
Atomic Upgrading of Distributed Systems
Atomic Upgrading of Distributed SystemsAtomic Upgrading of Distributed Systems
Atomic Upgrading of Distributed SystemsSander van der Burg
 
Model-driven Distributed Software Deployment
Model-driven Distributed Software DeploymentModel-driven Distributed Software Deployment
Model-driven Distributed Software DeploymentSander van der Burg
 
Model-driven Distributed Software Deployment
Model-driven Distributed Software DeploymentModel-driven Distributed Software Deployment
Model-driven Distributed Software DeploymentSander van der Burg
 
Model-driven Distributed Software Deployment laymen's talk
Model-driven Distributed Software Deployment laymen's talkModel-driven Distributed Software Deployment laymen's talk
Model-driven Distributed Software Deployment laymen's talkSander van der Burg
 

More from Sander van der Burg (15)

The Monitoring Playground
The Monitoring PlaygroundThe Monitoring Playground
The Monitoring Playground
 
Dysnomia: complementing Nix deployments with state deployment
Dysnomia: complementing Nix deployments with state deploymentDysnomia: complementing Nix deployments with state deployment
Dysnomia: complementing Nix deployments with state deployment
 
A Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentA Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software Deployment
 
A Generic Approach for Deploying and Upgrading Mutable Software Components
A Generic Approach for Deploying and Upgrading Mutable Software ComponentsA Generic Approach for Deploying and Upgrading Mutable Software Components
A Generic Approach for Deploying and Upgrading Mutable Software Components
 
Deploying .NET services with Disnix
Deploying .NET services with DisnixDeploying .NET services with Disnix
Deploying .NET services with Disnix
 
A Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented SystemsA Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented Systems
 
Pull Deployment of Services
Pull Deployment of ServicesPull Deployment of Services
Pull Deployment of Services
 
Disnix: A toolset for distributed deployment
Disnix: A toolset for distributed deploymentDisnix: A toolset for distributed deployment
Disnix: A toolset for distributed deployment
 
Automated Deployment of Hetergeneous Service-Oriented System
Automated Deployment of Hetergeneous Service-Oriented SystemAutomated Deployment of Hetergeneous Service-Oriented System
Automated Deployment of Hetergeneous Service-Oriented System
 
Pull Deployment of Services: Introduction, Progress and Challenges
Pull Deployment of Services: Introduction, Progress and ChallengesPull Deployment of Services: Introduction, Progress and Challenges
Pull Deployment of Services: Introduction, Progress and Challenges
 
Software Deployment in a Dynamic Cloud
Software Deployment in a Dynamic CloudSoftware Deployment in a Dynamic Cloud
Software Deployment in a Dynamic Cloud
 
Atomic Upgrading of Distributed Systems
Atomic Upgrading of Distributed SystemsAtomic Upgrading of Distributed Systems
Atomic Upgrading of Distributed Systems
 
Model-driven Distributed Software Deployment
Model-driven Distributed Software DeploymentModel-driven Distributed Software Deployment
Model-driven Distributed Software Deployment
 
Model-driven Distributed Software Deployment
Model-driven Distributed Software DeploymentModel-driven Distributed Software Deployment
Model-driven Distributed Software Deployment
 
Model-driven Distributed Software Deployment laymen's talk
Model-driven Distributed Software Deployment laymen's talkModel-driven Distributed Software Deployment laymen's talk
Model-driven Distributed Software Deployment laymen's talk
 

Recently uploaded

The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 

Recently uploaded (20)

The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 

Deploying NPM packages with the Nix package manager

  • 1. Deploying NPM packages with the Nix package manager Sander van der Burg Feb 4, 2017 Sander van der Burg Deploying NPM packages with the Nix package manager
  • 2. The Nix project Family of declarative software deployment tools: Nix. A purely functional package manager NixOS. Nix based GNU/Linux distribution Hydra. Nix based continuous build and integration server Disnix. Nix based distributed service deployment NixOps. NixOS-based multi-cloud deployment tool Sander van der Burg Deploying NPM packages with the Nix package manager
  • 3. The Nix project Non-functional properties: Generic. Can be used with many programming languages, component technologies, and operating systems. Reproducible. (Almost) no impurities – if inputs are the same, result should be the same. Reliable. Dependency completeness, (almost) atomic upgrades and rollbacks. Efficient. Only the required deployment activities are executed. Sander van der Burg Deploying NPM packages with the Nix package manager
  • 4. NixOS configuration /etc/nixos/configuration.nix {pkgs, ...}: { boot.loader.grub.device = "/dev/sda"; fileSystems = [ { mountPoint = "/"; device = "/dev/sda2"; } ]; swapDevices = [ { device = "/dev/sda1"; } ]; services = { openssh.enable = true; xserver = { enable = true; desktopManager.kde4.enable = true; }; }; environment.systemPackages = [ pkgs.mc pkgs.firefox ]; } Sander van der Burg Deploying NPM packages with the Nix package manager
  • 5. NixOS configuration nixos-rebuild switch Nix package manager builds a complete system configuration Includes all packages and generates all configuration files, e.g. OpenSSH configuration Upgrades are (almost) atomic Components are stored safely next to each other, due to hashes No files are automatically removed or overwritten Users can switch to older generations of system configurations not garbage collected yet Sander van der Burg Deploying NPM packages with the Nix package manager
  • 6. NixOS bootloader Sander van der Burg Deploying NPM packages with the Nix package manager
  • 7. The Nix project Basis of all tools: The Nix package manager Sander van der Burg Deploying NPM packages with the Nix package manager
  • 8. Nix store Main idea: store all packages in isolation from each other: /nix/store/rpdqxnilb0cg... -firefox-3.5.4 Paths contain a 160-bit cryptographic hash of all inputs used to build the package: Sources Libraries Compilers Build scripts . . . /nix/store l9w6773m1msy...-openssh-4.6p1 bin ssh sbin sshd smkabrbibqv7...-openssl-0.9.8e lib libssl.so.0.9.8 c6jbqm2mc0a7...-zlib-1.2.3 lib libz.so.1.2.3 im276akmsrhv...-glibc-2.5 lib libc.so.6 Sander van der Burg Deploying NPM packages with the Nix package manager
  • 9. Nix expressions openssh.nix { stdenv, fetchurl, openssl, zlib }: stdenv.mkDerivation { name = "openssh-4.6p1"; src = fetchurl { url = http://.../openssh-4.6p1.tar.gz; sha256 = "0fpjlr3bfind0y94bk442x2p..."; }; buildCommand = ’’ tar xjf $src ./configure --prefix=$out --with-openssl=${openssl} make; make install ’’; } Sander van der Burg Deploying NPM packages with the Nix package manager
  • 10. Nix expressions all-packages.nix openssh = import ../tools/networking/openssh { inherit fetchurl stdenv openssl zlib; }; openssl = import ../development/libraries/openssl { inherit fetchurl stdenv perl; }; stdenv = ...; openssl = ...; zlib = ...; perl = ...; nix-env -f all-packages.nix -iA openssh Produces a /nix/store/l9w6773m1msy...-openssh-4.6p1 package in the Nix store. Sander van der Burg Deploying NPM packages with the Nix package manager
  • 11. User environments Users can have different sets of installed applications. PATH /nix/.../profiles current 42 /nix/store pp56i0a01si5...-user-env bin firefox ssh l9w6773m1msy...-openssh-4.6p1 bin ssh rpdqxnilb0cg...-firefox-3.5.4 bin firefox Sander van der Burg Deploying NPM packages with the Nix package manager
  • 12. User environments Users can have different sets of installed applications. nix-env operations create new user environments in the store. PATH /nix/.../profiles current 42 /nix/store pp56i0a01si5...-user-env bin firefox ssh l9w6773m1msy...-openssh-4.6p1 bin ssh rpdqxnilb0cg...-firefox-3.5.4 bin firefox aqn3wygq9jzk...-openssh-5.2p1 bin ssh (nix-env -u openssh) Sander van der Burg Deploying NPM packages with the Nix package manager
  • 13. User environments Users can have different sets of installed applications. nix-env operations create new user environments in the store. PATH /nix/.../profiles current 42 /nix/store pp56i0a01si5...-user-env bin firefox ssh l9w6773m1msy...-openssh-4.6p1 bin ssh rpdqxnilb0cg...-firefox-3.5.4 bin firefox aqn3wygq9jzk...-openssh-5.2p1 bin ssh i3d9vh6d8ip1...-user-env bin ssh firefox (nix-env -u openssh) Sander van der Burg Deploying NPM packages with the Nix package manager
  • 14. User environments Users can have different sets of installed applications. nix-env operations create new user environments in the store. PATH /nix/.../profiles current 42 43 /nix/store pp56i0a01si5...-user-env bin firefox ssh l9w6773m1msy...-openssh-4.6p1 bin ssh rpdqxnilb0cg...-firefox-3.5.4 bin firefox aqn3wygq9jzk...-openssh-5.2p1 bin ssh i3d9vh6d8ip1...-user-env bin ssh firefox (nix-env -u openssh) Sander van der Burg Deploying NPM packages with the Nix package manager
  • 15. User environments Users can have different sets of installed applications. nix-env operations create new user environments in the store. We can atomically switch between them. PATH /nix/.../profiles current 42 43 /nix/store pp56i0a01si5...-user-env bin firefox ssh l9w6773m1msy...-openssh-4.6p1 bin ssh rpdqxnilb0cg...-firefox-3.5.4 bin firefox aqn3wygq9jzk...-openssh-5.2p1 bin ssh i3d9vh6d8ip1...-user-env bin ssh firefox (nix-env -u openssh) Sander van der Burg Deploying NPM packages with the Nix package manager
  • 16. User environments Users can have different sets of installed applications. nix-env operations create new user environments in the store. We can atomically switch between them. These are roots of the garbage collector. PATH /nix/.../profiles current 43 /nix/store pp56i0a01si5...-user-env bin firefox ssh l9w6773m1msy...-openssh-4.6p1 bin ssh rpdqxnilb0cg...-firefox-3.5.4 bin firefox aqn3wygq9jzk...-openssh-5.2p1 bin ssh i3d9vh6d8ip1...-user-env bin ssh firefox (nix-env --remove-generations old) Sander van der Burg Deploying NPM packages with the Nix package manager
  • 17. User environments Users can have different sets of installed applications. nix-env operations create new user environments in the store. We can atomically switch between them. These are roots of the garbage collector. PATH /nix/.../profiles current 43 /nix/store rpdqxnilb0cg...-firefox-3.5.4 bin firefox aqn3wygq9jzk...-openssh-5.2p1 bin ssh i3d9vh6d8ip1...-user-env bin ssh firefox (nix-collect-garbage) Sander van der Burg Deploying NPM packages with the Nix package manager
  • 18. Nix expressions openssh.nix { stdenv, fetchurl, openssl, zlib }: stdenv.mkDerivation { name = "openssh-4.6p1"; src = fetchurl { url = http://.../openssh-4.6p1.tar.gz; sha256 = "0fpjlr3bfind0y94bk442x2p..."; }; buildCommand = ’’ tar xjf $src ./configure --prefix=$out --with-openssl=${openssl} make; make install ’’; } Nix complements existing build tools with a pure environment You can also run other build tools in an environment, e.g. cmake, ant, scons Sander van der Burg Deploying NPM packages with the Nix package manager
  • 19. Pure environments Precautions in service of making build results bit-identical (regardless on what machine the package has been built): Clearing (most) environment variables or setting them to dummy values Modifying search environment variables to contain Nix store paths to only specified dependencies (e.g. PATH, PYTHONPATH, CLASSPATH, PERL5LIB) Using designated temp folders and output folders Making packages immutable by making their files read-only Resetting timestamps to 1 Chroot environments/namespaces Restricting network access Sander van der Burg Deploying NPM packages with the Nix package manager
  • 20. What about Node.js/NPM projects? NPM is Node.js’ ubiquitous deployment tool. NPM also does dependency management in addition to build management NPM’s dependency management conflicts with Nix’s dependency management Sander van der Burg Deploying NPM packages with the Nix package manager
  • 21. package.json configuration { "name" :"nijs", "version" :"0.0.23", "description" :"An internal DSL for the Nix package manager in JavaScript", "repository" :{ "type" :"git", "url" :"https://github.com/svanderburg/nijs.git" }, "author" :"Sander van der Burg", "license" :"MIT", "main" :"./lib/nijs", "dependencies" :{ "optparse" :">= 1.0.3", "slasp": "0.0.4" } } $ npm install $ ls node modules/ optparse slasp Sander van der Burg Deploying NPM packages with the Nix package manager
  • 22. Dealing with a conflicting dependency manager Solution: substitute the conflicting dependency manager by providing the dependencies with Nix first! Sander van der Burg Deploying NPM packages with the Nix package manager
  • 23. Solution: substitute NPM’s dependency management { stdenv, fetchgit, nodejs, optparse, slasp }: let nodeSources = ... in stdenv.mkDerivation { name = "nijs-0.0.23"; src = fetchgit { src = https://github.com/svanderburg/nijs.git; rev = "..."; sha256 = "..."; }; buildInputs = [ nodejs ]; buildCommand = ’’ # Compose node_modules/ folder from the dependencies ... # Perform the build by running npm install # Since a node_modules/ folder with the dependencies already exists, # NPM will not obtain them npm --registry http://www.example.com --nodedir=${nodeSources} install ’’; } Sander van der Burg Deploying NPM packages with the Nix package manager
  • 24. Solution: substitute NPM’s dependency management { stdenv, fetchgit, nodejs, optparse, slasp }: let nodeSources = ... in stdenv.mkDerivation { name = "nijs-0.0.23"; src = fetchgit { src = https://github.com/svanderburg/nijs.git; rev = "..."; sha256 = "..."; }; buildInputs = [ nodejs ]; buildCommand = ’’ # Compose node_modules/ folder from the dependencies ... # Perform the build by running npm install # Since a node_modules/ folder with the dependencies already exists, # NPM will not obtain them npm --registry http://www.example.com --nodedir=${nodeSources} install ’’; } Sander van der Burg Deploying NPM packages with the Nix package manager Substituting dependencies We may be able to automatically generate a Nix expression from a package.json file since they capture similar proper- ties!
  • 25. Solution: substitute NPM’s dependency management { stdenv, fetchgit, nodejs, optparse, slasp }: let nodeSources = ... in stdenv.mkDerivation { name = "nijs-0.0.23"; src = fetchgit { src = https://github.com/svanderburg/nijs.git; rev = "..."; sha256 = "..."; };; buildInputs = [ nodejs ]; buildCommand = ’’ # Compose node_modules/ folder from the dependencies ... # Perform the build by running npm install # Since a node_modules/ folder with the dependencies already exists, # NPM will not obtain them npm --registry http://www.example.com --nodedir=${nodeSources} install ’’; } Sander van der Burg Deploying NPM packages with the Nix package manager Substituting dependencies Appears to be straight forward! Is it really that straight forward?
  • 26. Generating Nix expressions It is actually much more complicated! Sander van der Burg Deploying NPM packages with the Nix package manager
  • 27. NPM dependency classes Dependencies: Run-time dependencies of a package Development dependencies: Build-time dependencies, e.g. transpilers Should only be installed if they have been requested Peer dependencies: Check whether a shared dependency does not conflict. In old versions of NPM, missing peer dependencies were also installed. Bundled dependencies: Statically bundled with a package. No need to install. Optional dependencies: Dependencies that are allowed to break. Typically used to bundle platform-specific code. Permitting errors (especially non-deterministic ones) incompatible with Nix deployment model Sander van der Burg Deploying NPM packages with the Nix package manager
  • 28. NPM dependency classes Dependencies: Run-time dependencies of a package Development dependencies: Build-time dependencies, e.g. transpilers Should only be installed if they have been requested Peer dependencies: Check whether a shared dependency does not conflict. In old versions of NPM, missing peer dependencies were also installed. Bundled dependencies: Statically bundled with a package. No need to install. Optional dependencies: Dependencies that are allowed to break. Typically used to bundle platform-specific code. Permitting errors (especially non-deterministic ones) incompatible with Nix deployment model Sander van der Burg Deploying NPM packages with the Nix package manager Interpreting dependency classes We only need to consider dependencies and development de- pendencies (if they are requested) and substract the bundled dependencies
  • 29. Version specifiers: NPM registry NPM version specifiers are nominal and semantically versioned: Precise version numbers: e.g. 1.0.0, 2.1.1 Version ranges and wildcards: e.g. 1.0.x, *, >= 1.0.1 Tags: latest, beta The above version specifiers refer to packages obtained from the NPM registry. Sander van der Burg Deploying NPM packages with the Nix package manager
  • 30. Version specifiers: external packages Local filesystem paths, e.g. /home/sander/nijs External URLs, e.g. http://example.com/packages/nijs-0.0.23.tgz Git URLs, e.g. https://github.com/svanderburg/nijs.git GitHub, BitBucket, GitLab, e.g. github:svanderburg/nijs Above specifiers obtain packages from other sources than the registry. They indirectly resolve to a package with a name and version number. Sander van der Burg Deploying NPM packages with the Nix package manager
  • 31. Version specifiers: translation to Nix Nix version specifiers are exact (any point of variation is reflected in the hash prefix): /nix/store/rpdqxnilb0cg...-firefox-3.5.4 Sander van der Burg Deploying NPM packages with the Nix package manager
  • 32. Version specifiers: translation to Nix Nix version specifiers are exact (any point of variation is reflected in the hash prefix): /nix/store/rpdqxnilb0cg...-firefox-3.5.4 To make a translation from NPM version specifiers to exact version specifiers: We must snapshot a version range and pinpoint the resolved version (version ranges are unsupported in Nix) We must supply the output hash to make it deterministic: src = fetchurl { url = "https://registry.npmjs.org/nijs/-/nijs-0.0.23.tgz"; sha1 = "dbf8f4a0acafbe3b8d9b71c24cbd1d851de6c31a"; }; Sander van der Burg Deploying NPM packages with the Nix package manager
  • 33. Private, shared and cyclic dependencies When including a package as a CommonJS module: ./node2nix/node modules/nijs/lib/execute/index.js var slasp = require(’slasp’); The module loader searches recursively upwards in node modules/ sub folders for the corresponding package: ./node2nix/nijs/node_modules/slasp ./node2nix/node_modules/slasp ./node_modules/slasp Sander van der Burg Deploying NPM packages with the Nix package manager
  • 34. Private, shared and cyclic dependencies Private dependency: a package residing in a package’s node modules/ sub folder. Shared dependency: a package residing in a parent directory’s node modules/ sub folder. Sander van der Burg Deploying NPM packages with the Nix package manager
  • 35. Private, shared and cyclic dependencies When installing dependencies with NPM, NPM will not install a dependency privately if a conforming shared dependency exists. Some undesired implications: A version range does not always yield the latest version that fits in a version range. Cyclic dependencies are permitted. Bad practice, as packages are supposed to be units of reuse. Sander van der Burg Deploying NPM packages with the Nix package manager
  • 36. Flat-module installations npm < 3.x installs dependencies privately by default (unless a conforming dependency exists in any parent node modules/ folder): webapp/ ... package.json node_modules/ express/ ... package.json node_modules/ accepts/ array-flatten/ content-disposition/ ... ejs/ ... package.json Sander van der Burg Deploying NPM packages with the Nix package manager
  • 37. Flat-module installations npm ≥ 3.x implements flat-module installations (moving packages as high as possible in the node modules/ hierarchy): webapp/ ... package.json node_modules/ accepts/ array-flatten/ content-disposition/ express/ ... package.json ejs/ ... package.json Because no packages conflict, they all appear in the top level node modules/ folder. Implications: Shorter path names, some degree of deduplication The order in which packages are installed matters Sander van der Burg Deploying NPM packages with the Nix package manager
  • 38. Simulating flat-module installations We cannot build each NPM dependency as a Nix package, with a separate store path: CommonJS module resolves its own symlink location. Some relative paths may not work: var slasp = require(’../slasp’); Flattening the module hierarchy is imperative. Nix packages are made immutable after they have been built. Solution: compose the entire dependency tree statically ahead of time in one Nix package Sander van der Burg Deploying NPM packages with the Nix package manager
  • 39. Replacing impure version specifiers Some version specifiers (e.g. tags and Git URLs), trigger NPM to always check the remote locations for changes in each npm install run: Replace these version specifiers by: ’*’. Downside: it sometimes confuses NPM, in particular flat module installations. Better solution: create fake processes (e.g git) giving a deterministic result. This is still an open issue. Sander van der Burg Deploying NPM packages with the Nix package manager
  • 40. The solution1 : node2nix 1 Sort of, but not entirely :-) Sander van der Burg Deploying NPM packages with the Nix package manager
  • 41. Example: using node2nix on project-level Generating Nix expressions from a package.json file: $ node2nix Building the project as a Nix package: $ nix-build -A package ./result/bin/node2nix --help Opening a development shell: $ nix-shell -A shell $ node bin/node2nix.js --help Sander van der Burg Deploying NPM packages with the Nix package manager
  • 42. Example: using node2nix on a package set custom-packages.json [ "node2nix" ,"bower" ,{"nijs": "https://github.com/svanderburg/nijs.git" } ,{"grunt-cli": "1.2.0" } ] Generating Nix expressions: $ node2nix -i custom-packages.json Installing an NPM package with Nix: $ nix-env -f default.nix -iA node2nix $ node2nix --help Sander van der Burg Deploying NPM packages with the Nix package manager
  • 43. Example: simulating global dependencies Global packages do not exist in Nix build environments. This is problematic for certain kinds of projects, such as Grunt projects, requiring the grunt-cli to be installed globally: package.json { "name": "grunt-test", "version": "0.0.1", "private": "true", "devDependencies": { "grunt": "*", "grunt-contrib-jshint": "*", "grunt-contrib-watch": "*" } } $ npm install $ grunt build Sander van der Burg Deploying NPM packages with the Nix package manager
  • 44. Example: simulating global dependencies We can supply global packages as extra packages: supplement.json [ "grunt-cli" ] And generate the expressions as follows: $ node2nix -d -i package.json --supplement-input supplement.json Sander van der Burg Deploying NPM packages with the Nix package manager
  • 45. Example: simulating global dependencies override.nix { pkgs ? import <nixpkgs> {} , system ? builtins.currentSystem }: let nodePackages = import ./default.nix { inherit pkgs system; }; in nodePackages // { package = nodePackages.package.override { postInstall = "grunt"; }; } $ nix-build override.nix Sander van der Burg Deploying NPM packages with the Nix package manager
  • 46. Conclusion I have explained Nix and NPM’s deployment concepts I have described node2nix generating Nix expressions from package.json configurations, making it possible to deploy NPM packages with the Nix package manager. Besides the package manager, it also becomes possible to deploy entire systems using Node.js with NixOps and Disnix. Sander van der Burg Deploying NPM packages with the Nix package manager
  • 47. Lessons Naming packages: a name and version number typically does not suffice! Nix uses hash codes derived from all build inputs .NET global assembly cache: strong names Organization: isolate dependencies Cyclic dependencies: disallow them – packages are supposed to be units of reuse Sander van der Burg Deploying NPM packages with the Nix package manager
  • 48. Related work: other generators npm2nix: Original generation attempt done by Shea Levy. Composes Nix store paths for each dependency and symlinks them. Faster, but less accurate when dealing when shared dependencies Does not support flat module installations or cyclic dependencies nixfromnpm: Implementation of npm2nix’s Nix concepts in Haskell. Can partially regenerate expressions. Sander van der Burg Deploying NPM packages with the Nix package manager
  • 49. Related work: NPM alternatives yarn: parallelization for speed improvements, version locking ied: parallelization, content-addressable store, atomicity, maximal sharing of dependencies (some of its concepts are heavily inspired by Nix according to its author :-) ) Sander van der Burg Deploying NPM packages with the Nix package manager
  • 50. References Nix project: http://nixos.org. Nix package manager: http://nixos.org/nix. node2nix: https://github.com/svanderburg/node2nix. Sander van der Burg Deploying NPM packages with the Nix package manager
  • 51. Questions Sander van der Burg Deploying NPM packages with the Nix package manager