mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
gatus: Small improvements
This commit is contained in:
parent
6f53e67250
commit
e914990eaf
1 changed files with 3 additions and 8 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.custom.services.gatus;
|
cfg = config.custom.services.gatus;
|
||||||
tailscaleCfg = config.custom.services.tailscale;
|
tailscaleDomain = config.custom.services.tailscale.domain;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.custom.services.gatus = {
|
options.custom.services.gatus = {
|
||||||
|
|
@ -30,11 +30,7 @@ in
|
||||||
};
|
};
|
||||||
group = lib.mkOption {
|
group = lib.mkOption {
|
||||||
type = lib.types.nonEmptyStr;
|
type = lib.types.nonEmptyStr;
|
||||||
default =
|
default = if config.domain |> lib.hasSuffix tailscaleDomain then "Private" else "Public";
|
||||||
let
|
|
||||||
isTailscale = config.domain |> lib.hasSuffix tailscaleCfg.domain;
|
|
||||||
in
|
|
||||||
if isTailscale then "Private" else "Public";
|
|
||||||
};
|
};
|
||||||
protocol = lib.mkOption {
|
protocol = lib.mkOption {
|
||||||
type = lib.types.nonEmptyStr;
|
type = lib.types.nonEmptyStr;
|
||||||
|
|
@ -87,13 +83,12 @@ in
|
||||||
defaultEndpoints =
|
defaultEndpoints =
|
||||||
cfg.domainsToMonitor
|
cfg.domainsToMonitor
|
||||||
|> lib.filter (domain: domain != cfg.domain)
|
|> lib.filter (domain: domain != cfg.domain)
|
||||||
|> lib.map (domain: lib.nameValuePair (getSubdomain domain) { domain = lib.mkDefault domain; })
|
|> lib.map (domain: lib.nameValuePair (getSubdomain domain) { inherit domain; })
|
||||||
|> lib.listToAttrs;
|
|> lib.listToAttrs;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
"healthchecks.io" = {
|
"healthchecks.io" = {
|
||||||
group = "Monitoring";
|
group = "Monitoring";
|
||||||
protocol = "https";
|
|
||||||
domain = "hc-ping.com";
|
domain = "hc-ping.com";
|
||||||
path = "/\${HEALTHCHECKS_PING_KEY}/${config.networking.hostName}-gatus-uptime?create=1";
|
path = "/\${HEALTHCHECKS_PING_KEY}/${config.networking.hostName}-gatus-uptime?create=1";
|
||||||
interval = "2h";
|
interval = "2h";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue