2024-06-14 19:42:14 +07:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.profile.services.stubby;
|
2024-06-17 19:54:21 +07:00
|
|
|
inherit (lib) mkIf lists;
|
2024-06-14 19:42:14 +07:00
|
|
|
in
|
|
|
|
{
|
|
|
|
config = mkIf cfg.enable {
|
2024-06-17 01:06:03 +07:00
|
|
|
networking.resolvconf.useLocalResolver = false;
|
2024-06-17 19:54:21 +07:00
|
|
|
networking.nameservers = lists.optional (!config.profile.podman.pihole.enable) "192.168.100.5";
|
2024-06-14 19:42:14 +07:00
|
|
|
services.stubby = {
|
|
|
|
enable = true;
|
|
|
|
settings = pkgs.stubby.passthru.settingsExample // {
|
2024-06-14 20:03:30 +07:00
|
|
|
listen_addresses = [
|
2024-06-17 01:06:03 +07:00
|
|
|
"192.168.100.5"
|
2024-06-14 20:03:30 +07:00
|
|
|
];
|
2024-06-14 19:42:14 +07:00
|
|
|
upstream_recursive_servers = [
|
|
|
|
{
|
|
|
|
address_data = "1.1.1.1";
|
2024-06-18 19:20:55 +07:00
|
|
|
tls_auth_name = "cloudflare-dns.com";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
address_data = "1.0.0.1";
|
2024-06-14 19:42:14 +07:00
|
|
|
tls_auth_name = "cloudflare-dns.com";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|