mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 14:01:34 +01:00
Refactor
This commit is contained in:
parent
0d7164fe0a
commit
49c918f747
13 changed files with 53 additions and 53 deletions
|
|
@ -143,21 +143,21 @@ in
|
|||
|
||||
endpoints =
|
||||
let
|
||||
mkEndpoint = value: {
|
||||
inherit (value) name group interval;
|
||||
url = "${value.protocol}://${value.domain}${value.path}";
|
||||
alerts = lib.mkIf value.enableAlerts [ { type = "ntfy"; } ];
|
||||
ssh = lib.mkIf (value.protocol == "ssh") {
|
||||
mkEndpoint = endpoint: {
|
||||
inherit (endpoint) name group interval;
|
||||
url = "${endpoint.protocol}://${endpoint.domain}${endpoint.path}";
|
||||
alerts = lib.mkIf endpoint.enableAlerts [ { type = "ntfy"; } ];
|
||||
ssh = lib.mkIf (endpoint.protocol == "ssh") {
|
||||
username = "";
|
||||
password = "";
|
||||
};
|
||||
conditions = lib.concatLists [
|
||||
value.extraConditions
|
||||
(lib.optional (lib.elem value.protocol [
|
||||
endpoint.extraConditions
|
||||
(lib.optional (lib.elem endpoint.protocol [
|
||||
"http"
|
||||
"https"
|
||||
]) "[STATUS] == 200")
|
||||
(lib.optional (lib.elem value.protocol [
|
||||
(lib.optional (lib.elem endpoint.protocol [
|
||||
"tcp"
|
||||
"ssh"
|
||||
"icmp"
|
||||
|
|
@ -176,7 +176,7 @@ in
|
|||
let
|
||||
defaultEndpoints =
|
||||
self.nixosConfigurations
|
||||
|> lib.mapAttrs (_: value: value.config.meta.domains.local)
|
||||
|> lib.mapAttrs (_: host: host.config.meta.domains.local)
|
||||
|> lib.concatMapAttrs (
|
||||
hostName: domains:
|
||||
domains
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue