/nodejs-with-nix

NodeJS + nix

Primary LanguageNixMIT LicenseMIT

Node.js with Nix

built with nix

This project showcases how to develop Node.js applications with Nix.

Requirements

Install Nix package manager.

Getting Started

Spawn a new shell with all project dependencies:

nix-shell

Install project dependencies:

npm install

Start the application:

node start # regular node process
# or
node run start:dev # for hot-reloading

Tips & Tricks

Build the project:

nix-build

Update node-packages.nix:

nix-shell
node2nix

Deployment

Install nixops:

nix-env -i nixops

Create a deployment:

nixops create ./nodejs-with-nix.nix ./nodejs-with-nix-vbox.nix -d nodejs-with-nix

Start the deployment:

nixops deploy -d nodejs-with-nix