service/blocky: fix config

This commit is contained in:
Felix Buehler 2023-06-04 21:08:37 +02:00
parent 0884576a60
commit 9ffa2e9111
3 changed files with 56 additions and 4 deletions

View file

@ -26,6 +26,10 @@ in
# passwordFile = secrets."dyndns/password".path;
# };
blocky = {
enable = true;
};
prowlarr = {
enable = true;
};

View file

@ -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;
}
];
};
}

View file

@ -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";