mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Add Nix flake for development environment (#23406)
Provides a Nix flake as an alternative to `scripts/bootstrap.sh` for setting up the Bun development environment. ## What's included: - **flake.nix**: Full development environment with all dependencies from bootstrap.sh - LLVM 19, CMake 3.30+, Node.js 24, Rust, Go - Build tools: ninja, ccache, pkg-config, make - Chromium dependencies for Puppeteer testing - gdb for core dump debugging - **shell.nix**: Simple wrapper for `nix-shell` usage - **cmake/CompilerFlags.cmake**: Nix compatibility fixes - Disable zstd debug compression (Nix's LLVM not built with zstd) - Set _FORTIFY_SOURCE=0 for -O0 debug builds - Downgrade _FORTIFY_SOURCE warning to not error ## Usage: ```bash nix-shell export CMAKE_SYSTEM_PROCESSOR=$(uname -m) bun bd ``` ## Verified working: ✅ Successfully compiles Bun debug build ✅ Binary tested: `./build/debug/bun-debug --version` → 1.2.24-debug ✅ All dependencies from bootstrap.sh included ## Advantages: - Fully isolated (no sudo required) - 100% reproducible dependency versions - Fast setup with binary caching --------- Co-authored-by: Claude Bot <claude-bot@bun.sh> Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,21 @@ Configuring a development environment for Bun can take 10-30 minutes depending o
|
||||
|
||||
If you are using Windows, please refer to [this guide](https://bun.com/docs/project/building-windows)
|
||||
|
||||
## Install Dependencies
|
||||
## Using Nix (Alternative)
|
||||
|
||||
A Nix flake is provided as an alternative to manual dependency installation:
|
||||
|
||||
```bash
|
||||
nix develop
|
||||
# or explicitly use the pure shell
|
||||
# nix develop .#pure
|
||||
export CMAKE_SYSTEM_PROCESSOR=$(uname -m)
|
||||
bun bd
|
||||
```
|
||||
|
||||
This provides all dependencies in an isolated, reproducible environment without requiring sudo.
|
||||
|
||||
## Install Dependencies (Manual)
|
||||
|
||||
Using your system's package manager, install Bun's dependencies:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user