From 9121101308179994e260214cf4ab98817911b980 Mon Sep 17 00:00:00 2001 From: Noratrieb <48135649+Noratrieb@users.noreply.github.com> Date: Mon, 4 Aug 2025 21:51:46 +0200 Subject: [PATCH] some hostnames --- nix/modules/default/default.nix | 8 ++++++-- nix/modules/garage/default.nix | 4 ++-- nix/modules/prometheus/default.nix | 7 +++---- nix/modules/wg-mesh/default.nix | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/nix/modules/default/default.nix b/nix/modules/default/default.nix index a1169a0..4139110 100644 --- a/nix/modules/default/default.nix +++ b/nix/modules/default/default.nix @@ -6,6 +6,10 @@ in { deployment.targetHost = "${name}.infra.noratrieb.dev"; + networking.hosts = { + "${networkingConfig.vps3.wg.privateIP}" = [ "loki.internal" "pyroscope.internal" "prometheus.internal" ]; + }; + imports = [ "${builtins.fetchTarball "https://github.com/ryantm/agenix/archive/de96bd907d5fbc3b14fc33ad37d1b9a3cb15edc6.tar.gz"}/modules/age.nix" # main 2024-07-26 ]; @@ -126,7 +130,7 @@ in }; clients = [ { - url = "http://vps3.local:3100/loki/api/v1/push"; + url = "http://loki.internal:3100/loki/api/v1/push"; } ]; scrape_configs = [ @@ -217,7 +221,7 @@ in pyroscope.write "endpoint" { endpoint { - url = "http://vps3.local:4040" + url = "http://pyroscope.internal:4040" } external_labels = { "instance" = env("HOSTNAME"), diff --git a/nix/modules/garage/default.nix b/nix/modules/garage/default.nix index e7f5331..dcd4ce9 100644 --- a/nix/modules/garage/default.nix +++ b/nix/modules/garage/default.nix @@ -35,12 +35,12 @@ in s3_api = { s3_region = "garage"; api_bind_addr = "[::]:3900"; - root_domain = ".s3.garage.localhost"; + root_domain = ".s3.garage.internal"; }; s3_web = { bind_addr = "[::]:3902"; - root_domain = ".web.garage.localhost"; + root_domain = ".web.garage.internal"; index = "index.html"; }; diff --git a/nix/modules/prometheus/default.nix b/nix/modules/prometheus/default.nix index 705f15f..7a2ef97 100644 --- a/nix/modules/prometheus/default.nix +++ b/nix/modules/prometheus/default.nix @@ -18,7 +18,6 @@ { job_name = "cadvisor"; static_configs = [{ targets = map (name: "${name}.local:8080") (builtins.attrNames networkingConfig); }]; - } { job_name = "systemd"; @@ -71,7 +70,7 @@ name = "Prometheus"; type = "prometheus"; access = "proxy"; - url = "http://vps3.local:9090"; + url = "http://prometheus.internal:9090"; jsonData = { httpMethod = "POST"; prometheusType = "Prometheus"; @@ -81,13 +80,13 @@ name = "loki"; type = "loki"; access = "proxy"; - url = "http://vps3.local:3100"; + url = "http://loki.internal:3100"; } { name = "pyroscope"; type = "grafana-pyroscope-datasource"; access = "proxy"; - url = "http://vps3.local:4040"; + url = "http://pyroscope.internal:4040"; } ]; }; diff --git a/nix/modules/wg-mesh/default.nix b/nix/modules/wg-mesh/default.nix index aad75b8..abb904a 100644 --- a/nix/modules/wg-mesh/default.nix +++ b/nix/modules/wg-mesh/default.nix @@ -9,7 +9,7 @@ in let hostsEntries = map (host: - let hostConfig = builtins.getAttr host networkingConfig; in + let hostConfig = networkingConfig."${host}"; in if builtins.hasAttr "wg" hostConfig then { name = hostConfig.wg.privateIP; value = [ "${host}.local" ];