Skip to content

Commit ccc0ece

Browse files
committed
docs(readme): improve Nix development environment setup instructions
- Add Nix installation command using experimental installer - Add instructions for enabling flakes if not already enabled - Clarify direnv activation (use existing .envrc) - Link to flake.nix for reference - Reorganise useful commands into separate section
1 parent a8a3bfc commit ccc0ece

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

README.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -337,20 +337,27 @@ For more examples, check out the [examples/](examples/) directory:
337337

338338
### Using Nix (Recommended)
339339

340-
[Nix](https://nixos.org/) with flakes provides a consistent development environment:
340+
This project includes a Nix flake for reproducible development environments. All development tools are defined in [flake.nix](./flake.nix) and provided via Nix.
341+
342+
#### Installing Nix
341343

342344
```bash
343-
# Enter development environment (auto-installs dependencies and git hooks)
344-
nix develop
345+
# Install Nix with flakes enabled (if not already installed)
346+
curl --proto '=https' --tlsv1.2 -sSf -L https://artifacts.nixos.org/experimental-installer | \
347+
sh -s -- install
345348

346-
# Or with direnv (recommended for automatic activation)
347-
direnv allow
349+
# If flakes are not enabled, enable them with:
350+
mkdir -p ~/.config/nix && echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
351+
```
348352

349-
# Format code
350-
nix fmt
353+
#### Activating the Development Environment
351354

352-
# Run checks
353-
nix flake check
355+
```bash
356+
# Automatic activation with direnv (recommended)
357+
direnv allow
358+
359+
# Or manual activation
360+
nix develop
354361
```
355362

356363
The Nix development environment includes:
@@ -360,6 +367,16 @@ The Nix development environment includes:
360367
- Git hooks (treefmt + ty) auto-configured
361368
- Consistent environment across all platforms
362369

370+
#### Useful Commands
371+
372+
```bash
373+
# Format code
374+
nix fmt
375+
376+
# Run checks
377+
nix flake check
378+
```
379+
363380
## License
364381

365382
Apache 2.0 License

0 commit comments

Comments
 (0)