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.
Schema
Section titled “Schema”| Property | Value |
|---|---|
| Type | list of strings |
| Default | [ ] |
| Set at | instances.<namespace>.<name>.aliases |
The instance name always remains a resolution key.
Interaction with package metadata
Section titled “Interaction with package metadata”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.
Resolution and collisions
Section titled “Resolution and collisions”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.