3
0
Fork 0
forked from mirrors/nixpkgs

NetworkManager: add noDns option

This commit is contained in:
jD91mZM2 2018-05-03 14:05:43 +02:00
parent 9e968fb553
commit 6c4c36fcbc
No known key found for this signature in database
GPG key ID: 3055D54729A72666
3 changed files with 22 additions and 8 deletions

View file

@ -227,6 +227,12 @@ $ nix-instantiate -E '(import <nixpkgsunstable> {}).gitFull'
</para> </para>
</note> </note>
</listitem> </listitem>
<listitem>
<para>
<literal>networking.networkmanager.useDnsmasq</literal> has been deprecated. Use
<literal>networking.networkmanager.dns</literal> instead.
</para>
</listitem>
</itemizedlist> </itemizedlist>
</section> </section>
</section> </section>

View file

@ -17,6 +17,7 @@ with lib;
(mkRenamedOptionModule [ "networking" "enableIntel2100BGFirmware" ] [ "hardware" "enableRedistributableFirmware" ]) (mkRenamedOptionModule [ "networking" "enableIntel2100BGFirmware" ] [ "hardware" "enableRedistributableFirmware" ])
(mkRenamedOptionModule [ "networking" "enableRalinkFirmware" ] [ "hardware" "enableRedistributableFirmware" ]) (mkRenamedOptionModule [ "networking" "enableRalinkFirmware" ] [ "hardware" "enableRedistributableFirmware" ])
(mkRenamedOptionModule [ "networking" "enableRTL8192cFirmware" ] [ "hardware" "enableRedistributableFirmware" ]) (mkRenamedOptionModule [ "networking" "enableRTL8192cFirmware" ] [ "hardware" "enableRedistributableFirmware" ])
(mkRenamedOptionModule [ "networking" "networkmanager" "useDnsmasq" ] [ "networking" "networkmanager" "dns" ])
(mkRenamedOptionModule [ "services" "cadvisor" "host" ] [ "services" "cadvisor" "listenAddress" ]) (mkRenamedOptionModule [ "services" "cadvisor" "host" ] [ "services" "cadvisor" "listenAddress" ])
(mkChangedOptionModule [ "services" "printing" "gutenprint" ] [ "services" "printing" "drivers" ] (mkChangedOptionModule [ "services" "printing" "gutenprint" ] [ "services" "printing" "drivers" ]

View file

@ -10,7 +10,8 @@ let
stateDirs = "/var/lib/NetworkManager /var/lib/dhclient /var/lib/misc"; stateDirs = "/var/lib/NetworkManager /var/lib/dhclient /var/lib/misc";
dns = dns =
if cfg.useDnsmasq then "dnsmasq" if cfg.dns == "none" then "none"
else if cfg.dns == "dnsmasq" then "dnsmasq"
else if config.services.resolved.enable then "systemd-resolved" else if config.services.resolved.enable then "systemd-resolved"
else if config.services.unbound.enable then "unbound" else if config.services.unbound.enable then "unbound"
else "default"; else "default";
@ -205,14 +206,20 @@ in {
}; };
}; };
useDnsmasq = mkOption { dns = mkOption {
type = types.bool; type = types.enum [ "auto" "dnsmasq" "none" ];
default = false; default = "auto";
description = '' description = ''
Enable NetworkManager's dnsmasq integration. NetworkManager will run Options:
dnsmasq as a local caching nameserver, using a "split DNS" - auto: Check for systemd-resolved, unbound, or use default.
configuration if you are connected to a VPN, and then update - dnsmasq:
resolv.conf to point to the local nameserver. Enable NetworkManager's dnsmasq integration. NetworkManager will run
dnsmasq as a local caching nameserver, using a "split DNS"
configuration if you are connected to a VPN, and then update
resolv.conf to point to the local nameserver.
- none:
Disable NetworkManager's DNS integration completely.
It will not touch your /etc/resolv.conf.
''; '';
}; };