mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 16:39:07 +01:00
Compare commits
7 commits
2f11b4eec2
...
286388294d
| Author | SHA1 | Date | |
|---|---|---|---|
| 286388294d | |||
| 49fc984039 | |||
| 16944ec493 | |||
| 0a8944823b | |||
| e6de0eab05 | |||
| 7e922ee312 | |||
| 0e6147c5ec |
2 changed files with 24 additions and 9 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue