mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-13 09:17:07 +03:00
networkmanager service: use resolved if enabled
This commit is contained in:
parent
a5a98f98a0
commit
12f54a5746
@ -9,11 +9,16 @@ let
|
|||||||
# /var/lib/misc is for dnsmasq.leases.
|
# /var/lib/misc is for dnsmasq.leases.
|
||||||
stateDirs = "/var/lib/NetworkManager /var/lib/dhclient /var/lib/misc";
|
stateDirs = "/var/lib/NetworkManager /var/lib/dhclient /var/lib/misc";
|
||||||
|
|
||||||
|
dns =
|
||||||
|
if cfg.useDnsmasq then "dnsmasq"
|
||||||
|
else if config.services.resolved.enable then "systemd-resolved"
|
||||||
|
else "default";
|
||||||
|
|
||||||
configFile = writeText "NetworkManager.conf" ''
|
configFile = writeText "NetworkManager.conf" ''
|
||||||
[main]
|
[main]
|
||||||
plugins=keyfile
|
plugins=keyfile
|
||||||
dhcp=${cfg.dhcp}
|
dhcp=${cfg.dhcp}
|
||||||
dns=${if cfg.useDnsmasq then "dnsmasq" else "default"}
|
dns=${dns}
|
||||||
|
|
||||||
[keyfile]
|
[keyfile]
|
||||||
${optionalString (cfg.unmanaged != [])
|
${optionalString (cfg.unmanaged != [])
|
||||||
|
Loading…
Reference in New Issue
Block a user