purr · git-hooks · nodejs · corepack · bun · direnv · nix-flake
Nix flake template for Node.js development — reproducible dev shell with Node.js runtime, Bun, Deno, unified package manager CLI (ni), and git pre-commit hooks. Built on purr and git-hooks.nix.
Part of the develop-templates collection (nix flake init-ready).
nix flake init -t "github:nixcafe/develop-templates#node" --refreshRegister an alias:
nix registry add beans "github:nixcafe/develop-templates"
nix flake init -t beans#nodeTip: With cattery-modules,
beansis pre-registered.
gh repo create my-node-project --template nixcafe/node --clonedirenv allow
# bootstrap & install deps
ni init
ni add express| Tool | Purpose |
|---|---|
node | Node.js runtime |
corepack | pnpm / yarn package manager manager |
ni / nr / nlx / nun / nci | @antfu/ni — unified package manager CLI |
bun | Bun JavaScript runtime & bundler |
deno | Deno JavaScript/TypeScript runtime |
node_modules/.bin is auto-added to PATH when it exists.
Edit develop/checks/git-hooks/default.nix — all hooks are disabled by default:
hooks={biome.enable=true;# eslint.enable = true;# denofmt.enable = true;};See git-hooks.nix for the full hook catalog.
# flake.nixoutputs=inputs:
inputs.purr.lib.mkFlake{inheritinputs;src=./develop;override=final: prev: {nodejs=final.nodejs_22;};};# develop/shells/default/default.nixpackages=withpkgs;[nodecorepackffmpegopenssl];.
├── flake.nix
├── .envrc
├── .gitignore
└── develop/
├── shells/
│ └── default/
│ └── default.nix
└── checks/
└── git-hooks/
└── default.nix