Compare commits

..

7 commits

2 changed files with 24 additions and 9 deletions

View file

@ -78,7 +78,12 @@ in
dnsServers = lib.mkOption {
type = lib.types.listOf lib.types.nonEmptyStr;
default = if (blocking-nameservers != [ ]) then blocking-nameservers else recursive-nameservers;
default =
{
"client" = if (blocking-nameservers != [ ]) then blocking-nameservers else recursive-nameservers;
"server" = recursive-nameservers;
}
.${cfg.role};
};
implementation = lib.mkOption {

View file

@ -8,6 +8,9 @@
let
cfg = config.custom.web-services.glance;
perHostDomains =
perHostSitesWidget.widgets |> lib.concatMap (widget: widget.sites) |> lib.map (site: site.domain);
perHostSitesWidget =
allHosts
|> lib.attrValues
@ -18,8 +21,7 @@ let
sites =
host.config.custom.meta.sites
|> lib.attrValues
|> lib.filter (site: site.domain |> lib.hasSuffix host.config.custom.networking.overlay.fqdn)
|> lib.map (site: site // { timeout = "5s"; });
|> lib.filter (site: site.domain |> lib.hasSuffix host.config.custom.networking.overlay.fqdn);
})
|> lib.filter ({ sites, ... }: sites != [ ])
|> (widgets: {
@ -28,9 +30,6 @@ let
inherit widgets;
});
perHostDomains =
perHostSitesWidget.widgets |> lib.concatMap (widget: widget.sites) |> lib.map (site: site.domain);
applicationSitesWidget =
allHosts
|> lib.attrValues
@ -45,7 +44,7 @@ let
type = "monitor";
cache = "1m";
title = "${name} Services";
sites = value |> lib.map (site: site // { timeout = "5s"; });
sites = value;
}
)
|> (widgets: {
@ -92,6 +91,17 @@ let
</div>
'';
};
dnsWidgets =
allHosts
|> lib.attrValues
|> lib.filter (host: host.config.custom.services.blocking-nameserver.enable)
|> lib.map (host: {
type = "dns-stats";
title = host.config.networking.hostName;
service = "adguard";
url = "https://${host.config.custom.services.blocking-nameserver.gui.domain}/";
});
in
{
options.custom.web-services.glance = {
@ -124,7 +134,7 @@ in
{
type = "search";
search-engine = "https://search.splitleaf.de/search?q={QUERY}";
autofocus = false;
autofocus = true;
}
applicationSitesWidget
perHostSitesWidget
@ -132,7 +142,7 @@ in
}
{
size = "small";
widgets = [ githubBadgeWidget ];
widgets = [ githubBadgeWidget ] ++ dnsWidgets;
}
];
};