From A Template
By default 2 templates are offered for starting off a new project with bun2nix enabled by default:
- A minimal hello world binary program - the default.
- A basic react website and server setup.
Notable files
The main files of note are:
flake.nix
⇒ Contains basic project setup for a nix flake forbun2nix
default.nix
⇒ Contains build instructions for this bun packagebun.nix
⇒ Generated bun expression frombun.lock
package.json
⇒ Standard JavaScriptpackage.json
with apostinstall
script pointing tobun2nix
Default - Minimal Setup
To produce the default minimal sample, run:
nix flake init -t github:baileyluTCD/bun2nix
This is a bare-bones project created via bun init
which produces a simple hello world binary packaged via bun2nix.
React Website
To start with the React website template run
nix flake init -t github:baileyluTCD/bun2nix#react
This is a simple example of a basic React app built through bun2nix.