2023-11-07 07:08:34 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
options.myFlake.nixos.networking.dns = lib.mkOption {
|
2023-11-09 04:07:37 +00:00
|
|
|
type = lib.types.enum ["google" "alidns"];
|
2023-11-07 07:08:34 +00:00
|
|
|
default = "google";
|
|
|
|
example = "alidns";
|
2023-11-17 07:17:12 +00:00
|
|
|
description = "Select desired DNS provider.";
|
2023-11-07 07:08:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config.networking.nameservers = lib.mkMerge [
|
|
|
|
(lib.mkIf (config.myFlake.nixos.networking.dns == "google") [
|
|
|
|
### Google DNS
|
|
|
|
"8.8.8.8"
|
|
|
|
"8.8.4.4"
|
|
|
|
"2001:4860:4860::8888"
|
|
|
|
"2001:4860:4860::8844"
|
|
|
|
])
|
|
|
|
(lib.mkIf (config.myFlake.nixos.networking.dns == "alidns") [
|
|
|
|
### AliDNS
|
|
|
|
"223.5.5.5"
|
|
|
|
"223.6.6.6"
|
|
|
|
"2400:3200::1"
|
|
|
|
"2400:3200:baba::1"
|
|
|
|
])
|
2023-11-04 10:02:11 +00:00
|
|
|
];
|
2023-11-04 10:14:42 +00:00
|
|
|
}
|