diff --git a/machines/serverle/services.nix b/machines/serverle/services.nix index 2857845..851c1ce 100644 --- a/machines/serverle/services.nix +++ b/machines/serverle/services.nix @@ -26,6 +26,10 @@ in # passwordFile = secrets."dyndns/password".path; # }; + blocky = { + enable = true; + }; + prowlarr = { enable = true; }; diff --git a/modules/services/blocky/default.nix b/modules/services/blocky/default.nix index a1b63cd..2463161 100644 --- a/modules/services/blocky/default.nix +++ b/modules/services/blocky/default.nix @@ -8,12 +8,19 @@ in options.my.services.blocky = with lib; { enable = mkEnableOption "Blocky DNS Server"; + httpPort = mkOption { + type = types.port; + default = 8053; + example = 8080; + description = "port for requests"; + }; + settings = mkOption { type = (pkgs.formats.json { }).type; default = { }; - example = { - "tlsPort" = ":853"; - }; + example = literalExpression '' + { ports.http = "8053" }; + ''; description = '' Override settings. ''; @@ -25,8 +32,42 @@ in enable = true; settings = { - "tlsPort" = ":853"; + ports = { + tls = "853"; + http = cfg.httpPort; + }; + upstream = { + default = [ + "dns2.digitalcourage.de2" # classic + "tcp-tls:dns3.digitalcourage.de" # DoT + "https://dns.digitale-gesellschaft.ch/dns-query" # DoH + ]; + }; + prometheus.enable = config.services.prometheus.enable; } // cfg.settings; }; + + services.prometheus.scrapeConfigs = [ + { + job_name = "blocky"; + static_configs = [ + { + targets = [ "127.0.0.1:${toString cfg.httpPort}" ]; + labels = { + instance = config.networking.hostName; + }; + } + ]; + } + ]; + + # untested + services.grafana.provision.dashboards.settings.providers = [ + { + name = "Blocky"; + options.path = pkgs.grafana-dashboards.blocky; + disableDeletion = true; + } + ]; }; } diff --git a/pkgs/grafana-dashboards/default.nix b/pkgs/grafana-dashboards/default.nix index bdf8dee..febd8de 100644 --- a/pkgs/grafana-dashboards/default.nix +++ b/pkgs/grafana-dashboards/default.nix @@ -58,6 +58,13 @@ in src = ./nextcloud.json; # sadly only imported dashboards work }); + blocky = buildGrafanaDashboard { + id = 13768; + pname = "blocky"; + version = "3"; + hash = "sha256-T1HqWbwt+i/Wa+Y2B7hcl3CijGxZF5aI38aPcXjk9y0="; + }; + navidrome = (buildGrafanaDashboard { id = 18038; pname = "navidrome";