Skip to content
kix /docs
Install the CLI

Reference Instance schema

config

Per-instance values evaluated against a package's typed options.

instances.apps.web = {
package = packages.web;
config = {
replicas = 3;
ingress.host = "web.example.com";
};
};

config supplies values for the options declared by the selected package. Kix evaluates the result before calling the package’s build entries and passes it to them as the config argument.

PropertyValue
Typedeferred Nix module
Default{ }
Set atinstances.<namespace>.<name>.config

Because config is a deferred module, several cluster modules may contribute values to the same instance. Standard Nix module priorities apply:

instances.apps.web.config.replicas = lib.mkDefault 2;

Use lib.mkForce only when the cluster must replace a package or module default that otherwise has higher priority. Conflicting plain definitions remain an evaluation error.

Kix evaluates the following together:

  1. the package’s options declarations and their defaults;
  2. the package’s own top-level config module;
  3. configuration injected through the package-level deps contract; and
  4. every module contributed to the instance’s config.

A package-level lib.mkDefault sits below values from the instance and from dependency injection, even when those values also use lib.mkDefault. Types and merge behavior come from the package’s option declarations. Unknown fields and values of the wrong type fail evaluation.

An instance can use a module function when configuration depends on another value:

instances.apps.web.config = { config, ... }: {
minAvailable = lib.mkDefault (config.replicas - 1);
};