From cc5c19071b4480131362188de07bee5b7e5b9d6f Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Wed, 2 Oct 2024 15:26:28 +0800 Subject: [PATCH] fixup --- hosts/aws/tyo0/services/prometheus.nix | 16 +++------------- hosts/dust/default.nix | 1 - nixos/profiles/restic/default.nix | 4 ++-- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/hosts/aws/tyo0/services/prometheus.nix b/hosts/aws/tyo0/services/prometheus.nix index 6f3a3bd..3218634 100644 --- a/hosts/aws/tyo0/services/prometheus.nix +++ b/hosts/aws/tyo0/services/prometheus.nix @@ -7,7 +7,7 @@ }: let inherit (config.lib) ports; - targets = lib.mapAttrsToList (_name: node: node.fqdn) nodes; + targets = lib.mapAttrsToList (_name: node: node.fqdn) nodes ++ [ "pek0.ny4.dev" ]; in { services.prometheus = { @@ -36,12 +36,7 @@ in username = "prometheus"; password_file = config.sops.secrets."prometheus/auth".path; }; - static_configs = lib.singleton { - targets = [ - "pek0.ny4.dev" - "tyo0.ny4.dev" - ] ++ targets; - }; + static_configs = lib.singleton { inherit targets; }; } { job_name = "caddy"; @@ -50,12 +45,7 @@ in username = "prometheus"; password_file = config.sops.secrets."prometheus/auth".path; }; - static_configs = lib.singleton { - targets = [ - "tyo0.ny4.dev" - "pek0.ny4.dev" - ] ++ targets; - }; + static_configs = lib.singleton { inherit targets; }; } { job_name = "blackbox_exporter"; diff --git a/hosts/dust/default.nix b/hosts/dust/default.nix index 69de060..a79014a 100644 --- a/hosts/dust/default.nix +++ b/hosts/dust/default.nix @@ -10,7 +10,6 @@ [ ../../nixos/profiles/restic ../../nixos/profiles/sing-box - ../../nixos/profiles/wireless ./anti-feature.nix ./disko.nix diff --git a/nixos/profiles/restic/default.nix b/nixos/profiles/restic/default.nix index e34e82e..aab59af 100644 --- a/nixos/profiles/restic/default.nix +++ b/nixos/profiles/restic/default.nix @@ -1,6 +1,6 @@ -{ config, ... }: +{ lib, config, ... }: { - sops.secrets = builtins.mapAttrs (_n: v: v // { sopsFile = ./secrets.yaml; }) { + sops.secrets = lib.mapAttrs (_n: v: v // { sopsFile = ./secrets.yaml; }) { "restic/environment" = { }; "restic/password" = { }; "restic/repository" = { };