Skip to content
kix /docs
Install the CLI

Reference Instance schema

aliases

Additional names by which dependency injection can resolve an instance.

instances.apps.redis = {
package = packages.valkey;
aliases = [ "cache" ];
};

aliases adds dependency-resolution names to an instance. A package whose build function requires cache can resolve the instance above even though its instance name is redis.

PropertyValue
Typelist of strings
Default[ ]
Set atinstances.<namespace>.<name>.aliases

The instance name always remains a resolution key.

When aliases is empty, Kix uses the package’s meta.defaultAliases. A non-empty list replaces those defaults rather than extending them. Include a default explicitly if the instance still needs it:

aliases = [ "cache" "valkey" ];

Package roles from meta.roles always remain resolution keys. Instance aliases do not replace them.

Kix prefers a matching managed instance over an import, then a match in the consumer’s namespace over matches elsewhere. More than one match at the deciding step is an error. Set deps.<argument> on the consumer when it must choose a particular instance:

instances.apps.web.deps.cache = ref.apps.redis;

Aliases also participate in optional-instance activation and in package catalog lookup. An alias claimed by several optional instances or several availablePackages entries is rejected when a consumer demands it.