Skip to main content
Bundlers transform Nix derivations into distributable artifacts for different platforms and deployment targets. Nur Nix provides multiple bundler types optimized for different use cases.

What are Bundlers?

Bundlers take a Nix derivation (a package built with Nix) and convert it into a format suitable for distribution. This enables you to:
  • Cross-compile applications for different operating systems and architectures
  • Containerize applications as Docker images
  • Optimize binary sizes with compression
  • Distribute standalone executables without Nix dependencies

Available Bundlers

Nur Nix provides bundlers organized by compilation target:

Deno Bundlers

Cross-compile JavaScript/TypeScript apps to standalone binaries for 5 platforms

Go Bundlers

Cross-compile Go applications with optional UPX compression for 6 platforms

Docker Bundlers

Package applications as Docker images with layered or streamed output

System Format

Bundler names use the {system} format to specify target platforms:
SystemArchitectureOSExample Use
x86_64-linuxx86_64 (AMD64)LinuxServers, cloud VMs
aarch64-linuxARM64LinuxRaspberry Pi, ARM servers
x86_64-darwinx86_64 (AMD64)macOSIntel Macs
aarch64-darwinARM64macOSApple Silicon Macs
x86_64-windowsx86_64 (AMD64)WindowsDesktop/server
arm-linuxARMLinuxOlder ARM devices
The {system} format ensures consistent cross-platform targeting across all bundlers.

Basic Usage

All bundlers are invoked using the nix bundle command:
nix bundle \
  --bundler github:nurpkgs/nur-nix#docker \
  .#myapp

Command Structure

  • --bundler - Specifies the bundler to use (from the Nur Nix registry)
  • .#myapp - References the derivation to bundle (from your flake)

Bundler Categories

Cross-Compilation Bundlers

Create standalone executables for different platforms:
  • Deno: deno-{system} - For JavaScript/TypeScript applications
  • Go: go-{system} - For Go applications
  • Go Compressed: go-compress-{system} - Go with UPX compression

Container Bundlers

Package applications as Docker images:
  • docker - Creates a layered Docker image (saved as .tar.gz)
  • docker-stream - Streams a layered Docker image (for piping to docker load)

Practical Example

Here’s how to bundle a Deno application for multiple platforms:
# Linux x86_64
nix bundle \
  --bundler github:nurpkgs/nur-nix#deno-x86_64-linux \
  .#myapp

# macOS Apple Silicon
nix bundle \
  --bundler github:nurpkgs/nur-nix#deno-aarch64-darwin \
  .#myapp

# Windows
nix bundle \
  --bundler github:nurpkgs/nur-nix#deno-x86_64-windows \
  .#myapp

Output Location

Bundled artifacts are placed in the Nix store at:
/nix/store/<hash>-<package-name>-<system>/
For executables:
/nix/store/<hash>-<package-name>-<system>/bin/<binary-name>
For Docker images:
/nix/store/<hash>-docker-image-<package-name>.tar.gz

Next Steps

Deno Bundlers

JavaScript/TypeScript

Go Bundlers

Go applications

Docker Bundlers

Container images

Build docs developers (and LLMs) love