2023-11-07 07:08:34 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
2023-11-19 05:33:31 +00:00
|
|
|
}: let
|
|
|
|
cfg = config.myFlake.darwin.networking.dns;
|
|
|
|
in {
|
|
|
|
options = {
|
|
|
|
myFlake.darwin.networking.dns = {
|
|
|
|
provider = lib.mkOption {
|
2023-12-13 11:02:11 +00:00
|
|
|
type = lib.types.enum ["dhcp" "google" "alidns"];
|
|
|
|
default =
|
|
|
|
{
|
|
|
|
"Asia/Shanghai" = "alidns";
|
|
|
|
}
|
|
|
|
.${config.time.timeZone}
|
|
|
|
or "google";
|
2023-11-19 05:33:31 +00:00
|
|
|
example = "alidns";
|
|
|
|
description = "Select desired DNS provider.";
|
|
|
|
};
|
|
|
|
};
|
2023-11-07 07:08:34 +00:00
|
|
|
};
|
|
|
|
|
2023-11-19 05:33:31 +00:00
|
|
|
config = {
|
2023-12-13 11:02:11 +00:00
|
|
|
networking.dns =
|
|
|
|
{
|
|
|
|
dhcp = [];
|
|
|
|
google = [
|
|
|
|
### Google DNS
|
|
|
|
"8.8.8.8"
|
|
|
|
"8.8.4.4"
|
|
|
|
"2001:4860:4860::8888"
|
|
|
|
"2001:4860:4860::8844"
|
|
|
|
];
|
|
|
|
alidns = [
|
|
|
|
### AliDNS
|
|
|
|
"223.5.5.5"
|
|
|
|
"223.6.6.6"
|
|
|
|
"2400:3200::1"
|
|
|
|
"2400:3200:baba::1"
|
|
|
|
];
|
|
|
|
}
|
|
|
|
.${cfg.provider};
|
2023-11-19 05:33:31 +00:00
|
|
|
};
|
2023-11-04 10:14:42 +00:00
|
|
|
}
|