Skip to content

Why we built a Kubernetes compiler on Nix.

Kix uses Nix to track dependencies between resources, validate clusters without live API access, and give fast compiler feedback to engineers and coding agents.

Why Nix?

Kix definitions are written in the Nix language, part of a build system used for reproducible software for over 20 years. Kix relies on four capabilities from Nix and its standard library.

  • String context

    Nix strings can carry hidden context paths alongside their text. Kix encodes resource identity on every output and endpoint details on network addresses. Nix preserves that context through string interpolation, and Kix carries it through ConfigMaps to order deployments and generate network policies.

  • Pure evaluation

    In pure evaluation, Nix expressions cannot read environment variables, undeclared files, or live network APIs. Evaluating a definition never contacts a cluster, so kix check and kix build run without cluster credentials.

  • Locked inputs

    flake.lock pins the Kix library and external inputs by hash, and image digests are committed with the definition. The same commit builds the same resources.

  • The module system

    Cluster and package options have types and defaults, and settings from cluster profiles and clusters merge 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 changes grouped by package from kix diff before approving a deployment.

  1. agent or person edit the cluster definition
  2. kix $ kix check Names the resource and explains what to fix. back to the definition until it builds
  3. kix $ kix diff The plan, grouped by package.
  4. you review the plan Review the changes by package on the pull request.
  5. kix $ kix deploy In dependency order, waiting on readiness.

Compile your first cluster.

Install Kix, compile an example, and review the plan before deploying.

curl -fsSL https://kix.run/install | sh
Setup guide Read the docs