mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
networkmanager service: use resolved if enabled
This commit is contained in:
parent
a5a98f98a0
commit
12f54a5746
1 changed files with 6 additions and 1 deletions
|
@ -9,11 +9,16 @@ let
|
|||
# /var/lib/misc is for dnsmasq.leases.
|
||||
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" ''
|
||||
[main]
|
||||
plugins=keyfile
|
||||
dhcp=${cfg.dhcp}
|
||||
dns=${if cfg.useDnsmasq then "dnsmasq" else "default"}
|
||||
dns=${dns}
|
||||
|
||||
[keyfile]
|
||||
${optionalString (cfg.unmanaged != [])
|
||||
|
|
Loading…
Reference in a new issue