config/c3d2: add static resolv.conf only if systemd-resolved is disabled

This commit is contained in:
Astro 2022-06-17 01:30:29 +02:00
parent 09d88ff8b4
commit ab9d2680c4
1 changed files with 6 additions and 4 deletions

View File

@ -138,15 +138,17 @@ in {
};
};
networking.useHostResolvConf = false;
networking.nameservers = with hostRegistry.hosts.dnscache; [
ip4
ip6
"9.9.9.9"
];
environment.etc."resolv.conf".text = lib.concatMapStrings (ns: ''
nameserver ${ns}
'') config.networking.nameservers;
networking.useHostResolvConf = lib.mkIf (!config.services.resolved.enable) true;
environment.etc."resolv.conf" = lib.mkIf (!config.services.resolved.enable) {
text = lib.concatMapStrings (ns: ''
nameserver ${ns}
'') config.networking.nameservers;
};
nix = {
autoOptimiseStore = true;