@@ -12,6 +12,7 @@ let
1212 configFile = writeText "NetworkManager.conf" ''
1313 [main]
1414 plugins=keyfile
15+ dns=${if cfg.useDnsmasq then "dnsmasq" else "default"}
1516
1617 [keyfile]
1718 ${optionalString (config.networking.hostName != "")
@@ -158,6 +159,17 @@ in {
158159 ethernet.macAddress = macAddressOpt;
159160 wifi.macAddress = macAddressOpt;
160161
162+ useDnsmasq = mkOption {
163+ type = types.bool;
164+ default = false;
165+ description = ''
166+ Enable NetworkManager's dnsmasq integration. NetworkManager will run
167+ dnsmasq as a local caching nameserver, using a "split DNS"
168+ configuration if you are connected to a VPN, and then update
169+ resolv.conf to point to the local nameserver.
170+ '';
171+ };
172+
161173 dispatcherScripts = mkOption {
162174 type = types.listOf (types.submodule {
163175 options = {