mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 18:41:34 +01:00
Deduce gatus endpoint group from domain when possible
This commit is contained in:
parent
efe6da5582
commit
dbe87bc88a
7 changed files with 11 additions and 20 deletions
|
|
@ -29,8 +29,8 @@ in
|
|||
default = name;
|
||||
};
|
||||
group = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
};
|
||||
url = lib.mkOption {
|
||||
type = lib.types.nonEmptyStr;
|
||||
|
|
@ -101,8 +101,13 @@ in
|
|||
url,
|
||||
extraConditions,
|
||||
}:
|
||||
let
|
||||
isPrivate = lib.hasInfix config.custom.services.tailscale.domain url;
|
||||
deducedGroup = if isPrivate then "Private" else "Public";
|
||||
in
|
||||
{
|
||||
inherit name group url;
|
||||
inherit name url;
|
||||
group = if group == null then deducedGroup else group;
|
||||
interval = "30s";
|
||||
alerts = [ { type = "ntfy"; } ];
|
||||
ssh = lib.mkIf (lib.hasPrefix "ssh" url) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue