Skip to content

Commit ae53062

Browse files
committed
docs: add nix development environment section to readme
Document Nix setup for reproducible development: - quick start commands (develop, check, build, fmt) - benefits: hermetic testing, multi-version support, no docker dependency - explain why Nix was introduced (reproducible builds, consistent environments)
1 parent 1b7bc82 commit ae53062

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,40 @@ This project makes use of [go workspaces](https://go.dev/ref/mod#workspaces) in
4343
generated code during development while keeping the codebase as tidy and maintainable as possible.
4444
It's an unusual choice, but it allows to not only test the code-generation logic, but also the generated code itself.
4545

46+
## Nix Development Environment
47+
48+
This project uses [Nix](https://nixos.org/) for reproducible development environments and CI/CD.
49+
Nix solves dependency management across different systems, ensuring consistent builds and tests regardless of your
50+
local setup.
51+
52+
### Quick Start
53+
54+
```shell
55+
# Enter development shell with all tools
56+
nix develop
57+
58+
# Run all checks (tests, lints, formatting)
59+
nix flake check
60+
61+
# Run specific checks
62+
nix build .#checks.x86_64-linux.tests-go125 # Integration tests
63+
nix build .#checks.x86_64-linux.lint-golang # Go linting
64+
nix build .#checks.x86_64-linux.build-goreleaser # GoReleaser build
65+
66+
# Format code
67+
nix fmt
68+
69+
# Test CI workflows locally
70+
nix run .#test-ci
71+
```
72+
73+
### Why Nix?
74+
75+
- **Reproducible builds**: Same dependencies across all environments (dev, CI, production)
76+
- **Hermetic testing**: Tests run in isolated sandboxes with no external network access
77+
- **Multi-version support**: Test against Go 1.24 and 1.25 simultaneously
78+
- **No Docker required**: Native support for NixOS and other Linux distributions
79+
4680
## Usage
4781

4882
At its most basic:

0 commit comments

Comments
 (0)