Skip to content

Declaring a dependency between services (require)

A service can require another to be enabled on the same host. The dependency is declared in the dnf/config/modules.nix registry, not in the module itself.

dnf/config/modules.nix
monitoring = {
require = [ "prometheus" ];
};

The generator validates the rule: enabling monitoring on a host that does not have prometheus causes the generation to fail (with an explicit message). This is a consistency safeguard, not an automatic activation: the administrator must declare both services.