networkd: Support Host Resolvconf
This commit is contained in:
parent
295a17f872
commit
8cffa37787
|
@ -43,10 +43,6 @@ in
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
warnings =
|
|
||||||
optional (config.services.resolved.enable && config.environment.etc ? "resolvconf.conf")
|
|
||||||
"Openresolv is disabled if resolved is used, so resolvconf.conf is not referenced.";
|
|
||||||
|
|
||||||
environment.etc =
|
environment.etc =
|
||||||
{ # /etc/services: TCP/UDP port assignments.
|
{ # /etc/services: TCP/UDP port assignments.
|
||||||
"services".source = pkgs.iana_etc + "/etc/services";
|
"services".source = pkgs.iana_etc + "/etc/services";
|
||||||
|
@ -66,16 +62,7 @@ in
|
||||||
''}
|
''}
|
||||||
${cfg.extraHosts}
|
${cfg.extraHosts}
|
||||||
'';
|
'';
|
||||||
} // (if config.services.resolved.enable && dnsmasqResolve then {
|
|
||||||
"dnsmasq-resolv.conf".source = "/run/systemd/resolve/resolv.conf";
|
|
||||||
} else {}) // (if config.services.resolved.enable then {
|
|
||||||
# /etc/resolv.conf: Configuration for systemd-resolved.
|
|
||||||
"resolv.conf" = if hasLocalResolver then {
|
|
||||||
text = "nameserver 127.0.0.1";
|
|
||||||
} else {
|
|
||||||
source = "/run/systemd/resolve/resolv.conf";
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
# /etc/resolvconf.conf: Configuration for openresolv.
|
# /etc/resolvconf.conf: Configuration for openresolv.
|
||||||
"resolvconf.conf".text =
|
"resolvconf.conf".text =
|
||||||
''
|
''
|
||||||
|
@ -97,7 +84,14 @@ in
|
||||||
dnsmasq_conf=/etc/dnsmasq-conf.conf
|
dnsmasq_conf=/etc/dnsmasq-conf.conf
|
||||||
dnsmasq_resolv=/etc/dnsmasq-resolv.conf
|
dnsmasq_resolv=/etc/dnsmasq-resolv.conf
|
||||||
'';
|
'';
|
||||||
});
|
|
||||||
|
} // (optionalAttrs config.services.resolved.enable (
|
||||||
|
if dnsmasqResolve then {
|
||||||
|
"dnsmasq-resolv.conf".source = "/run/systemd/resolve/resolv.conf";
|
||||||
|
} else {
|
||||||
|
"resolv.conf".source = "/run/systemd/resolve/resolv.conf";
|
||||||
|
}
|
||||||
|
));
|
||||||
|
|
||||||
# The ‘ip-up’ target is started when we have IP connectivity. So
|
# The ‘ip-up’ target is started when we have IP connectivity. So
|
||||||
# services that depend on IP connectivity (like ntpd) should be
|
# services that depend on IP connectivity (like ntpd) should be
|
||||||
|
|
|
@ -35,9 +35,6 @@ in
|
||||||
assertions = [ {
|
assertions = [ {
|
||||||
assertion = cfg.defaultGatewayWindowSize == null;
|
assertion = cfg.defaultGatewayWindowSize == null;
|
||||||
message = "networking.defaultGatewayWindowSize is not supported by networkd.";
|
message = "networking.defaultGatewayWindowSize is not supported by networkd.";
|
||||||
} {
|
|
||||||
assertion = ! cfg.useHostResolvConf;
|
|
||||||
message = "networking.useHostResolvConf is not supported by networkd.";
|
|
||||||
} ];
|
} ];
|
||||||
|
|
||||||
systemd.services.dhcpcd.enable = mkDefault false;
|
systemd.services.dhcpcd.enable = mkDefault false;
|
||||||
|
|
Loading…
Reference in New Issue