Why we built a Kubernetes compiler on the Nix language.
Kix uses the Nix configuration language for dependency tracking, hermetic offline evaluation, and instant compiler feedback for both engineers and coding agents.
Why the Nix language?
Kix definitions are written in the Nix language, which has been used for reproducible builds for over 20 years. Kix relies on four of the language's features directly.
-
String context
Nix strings can carry hidden context paths alongside their text. Kix attaches resource identity and endpoint metadata to every output, and Nix preserves that metadata through string interpolation and ConfigMaps so Kix can trace every dependency and network edge.
-
Pure evaluation
A Nix expression cannot change anything outside the evaluation. Evaluating a definition never calls the Kubernetes API, so
kix checkandkix buildrun without cluster credentials. -
Locked inputs
flake.lockpins Kix and every package by hash, and image digests are committed with the definition. The same commit builds the same resources. -
The module system
Package options have types and defaults, and settings from flavors and clusters are merged by the same rules everywhere.
Compiler feedback for people and agents
An agent can edit a Kix definition and use compiler errors to revise it. The resulting plan gives you a manageable view of the proposed change before deployment.
-
Agents write infrastructure code now.
Agents already write Kubernetes configuration for many teams, so they need the same checks that a person would use.
-
An agent needs fast, exact feedback.
Kix identifies the affected resource and explains the error, giving the agent something specific to correct.
-
You need something small enough to review.
You can review the results of kix check and the package-level plan from kix diff before approving a change.
- agent or person edit the cluster definition
- kix $ kix check Names the resource and explains what to fix. back to the definition until it builds
- kix $ kix diff The plan, grouped by package.
- you review the plan Review the changes by package on the pull request.
- kix $ kix deploy In dependency order, waiting on readiness.