Overview
The project uses nixidy to generate Kubernetes manifests from Nix expressions. This approach provides type safety, modularity, and deterministic builds.Quick Start
Regenerate all manifests:How Manifest Generation Works
Build Process
Thegen-manifests script (scripts/gen-manifests.sh:10-22):
-
Build nixidy environment package:
-
Copy to manifests directory:
-
Remove ArgoCD self-management app:
-
Show diff:
Output Structure
Generated manifests are organized by application:Nixidy Module Structure
Environment Definition
The environment is defined innixidy/env/local.nix:
Application Modules
Each application has its own module innixidy/env/local/, for example:
argocd.nix- GitOps controllergarage.nix- S3-compatible storagekube-prometheus-stack.nix- Prometheus + Grafana + Alertmanagerloki.nix- Log aggregationtempo.nix- Distributed tracing backendtraefik.nix- Ingress with middlewarepostgresql.nix- Relational database
Helm Chart Integration
Nixidy integrates with nixhelm for Helm chart management:Live Reloading with watch-manifests
Thewatch-manifests command (devenv.nix:107-110) provides automatic rebuild and apply:
- Watches all
.nixfiles in the repository - On change: rebuilds manifests and applies to cluster
- Restarts on each change (kills previous run)
- Useful for rapid iteration on nixidy modules
Validation and Testing
Quick Nix Check
Validate Nix expressions without building:Full Flake Check
Run all flake checks:Common Workflows
Add a New Application
- Create module in
nixidy/env/local/myapp.nix - Add import to
nixidy/env/local.nix - Generate manifests:
- Review changes:
- Apply:
Update Helm Chart Version
- Edit version in
nixidy/env/local/myapp.nix - Run
fix-chart-hashto update chartHash automatically - Generate manifests:
- Test in cluster:
Debug Manifest Generation
Benefits of Nixidy
Type Safety
Nix provides compile-time validation of manifest structure, catching errors before deployment.Deterministic Builds
Same inputs always produce identical manifests. Chart hashes ensure reproducibility.Modularity
Each application is a self-contained module that can be imported, overridden, or excluded.GitOps Integration
Generated manifests are committed to Git, providing:- Full audit trail of changes
- Easy rollbacks
- Clear diff reviews
Troubleshooting
Build Fails with Hash Mismatch
Update chart hash:Watch-manifests Not Triggering
Check that watchexec is installed:.nix files (other extensions are ignored).