mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 15:29:07 +01:00
Improve wording of assertion messages
This commit is contained in:
parent
93652012d0
commit
e20ad1398b
3 changed files with 4 additions and 4 deletions
|
|
@ -29,7 +29,7 @@ in
|
|||
config = lib.mkIf cfg.enable {
|
||||
assertions = lib.singleton {
|
||||
assertion = netCfg.overlay.isLighthouse -> netCfg.underlay.isPublic;
|
||||
message = "'${netCfg.hostName}' is a Nebula lighthouse, but underlay.isPublic is not set. Lighthouses must be publicly reachable.";
|
||||
message = "`${netCfg.hostName}` is a Nebula lighthouse, but `underlay.isPublic` is not set. Lighthouses must be publicly reachable.";
|
||||
};
|
||||
|
||||
custom.networking.overlay = {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ in
|
|||
assertions = [
|
||||
{
|
||||
assertion = cfg.isServer -> (cfg.gui.domain != null);
|
||||
message = "Running syncthing on a server requires `gui.domain` to be set";
|
||||
message = "Syncthing requires `gui.domain` to be set when `isServer` is enabled";
|
||||
}
|
||||
{
|
||||
assertion = (cfg.gui.domain != null) -> (self.lib.isPrivateDomain cfg.gui.domain);
|
||||
|
|
|
|||
|
|
@ -51,14 +51,14 @@ in
|
|||
|> lib.filter (name: name != "system")
|
||||
|> lib.map (name: {
|
||||
assertion = cfg.collect.metrics.${name} -> config.services.${name}.enable;
|
||||
message = "Collecting ${name} metrics requires the ${name} service to be enabled";
|
||||
message = "Alloy cannot collect `${name}` metrics without the `${name}` service";
|
||||
});
|
||||
logsAssertions =
|
||||
cfg.collect.logs
|
||||
|> lib.attrNames
|
||||
|> lib.map (name: {
|
||||
assertion = cfg.collect.logs.${name} -> config.services.${name}.enable;
|
||||
message = "Collecting ${name} logs requires the ${name} service to be enabled";
|
||||
message = "Alloy cannot collect '${name}' logs without the '${name}' service";
|
||||
});
|
||||
in
|
||||
metricsAssertions ++ logsAssertions;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue