mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-06-08 02:09:04 +02:00
feat: finish stateless uptime kuma monitors configuration
This commit is contained in:
parent
305070d9b1
commit
04f9dd2d7c
5 changed files with 27 additions and 3 deletions
|
@ -1,4 +1,9 @@
|
|||
{ lib, profiles, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
profiles,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.machine.meta = lib.mkOption {
|
||||
description = "Machine metadata";
|
||||
|
@ -38,6 +43,11 @@
|
|||
default = with profiles; [ base ];
|
||||
};
|
||||
|
||||
monitors = mkOption {
|
||||
default = { };
|
||||
type = types.attrsOf (pkgs.formats.json { }).type;
|
||||
};
|
||||
|
||||
defaultInterface = mkOption {
|
||||
description = "default interface of the machine";
|
||||
default = "ens18";
|
||||
|
|
|
@ -59,7 +59,7 @@ in
|
|||
'';
|
||||
|
||||
systemConfig = _: {
|
||||
statelessUptimeKuma.probesConfig.monitors = lib.mkIf (name != "default") {
|
||||
machine.meta.monitors = lib.mkIf (name != "default") {
|
||||
"${name} - IPv4" = {
|
||||
url = "https://${
|
||||
if (hasSuffix "luj" name) then
|
||||
|
@ -167,7 +167,6 @@ in
|
|||
];
|
||||
|
||||
machine = mergeSub (c: c.machine);
|
||||
statelessUptimeKuma = mergeSub (c: c.statelessUptimeKuma);
|
||||
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue