network-manager: add support for internal DHCP

This commit is contained in:
Peter Hoeg 2017-06-02 19:05:22 +08:00
parent 1fe17ee116
commit a087081ebb

View File

@ -12,6 +12,7 @@ let
configFile = writeText "NetworkManager.conf" '' configFile = writeText "NetworkManager.conf" ''
[main] [main]
plugins=keyfile plugins=keyfile
dhcp=${cfg.dhcp}
dns=${if cfg.useDnsmasq then "dnsmasq" else "default"} dns=${if cfg.useDnsmasq then "dnsmasq" else "default"}
[keyfile] [keyfile]
@ -21,7 +22,7 @@ let
''unmanaged-devices=${lib.concatStringsSep ";" cfg.unmanaged}''} ''unmanaged-devices=${lib.concatStringsSep ";" cfg.unmanaged}''}
[logging] [logging]
level=WARN level=${cfg.logLevel}
[connection] [connection]
ipv6.ip6-privacy=2 ipv6.ip6-privacy=2
@ -138,6 +139,22 @@ in {
apply = list: (attrValues cfg.basePackages) ++ list; apply = list: (attrValues cfg.basePackages) ++ list;
}; };
dhcp = mkOption {
type = types.enum [ "dhclient" "dhcpcd" "internal" ];
default = "dhclient";
description = ''
Which program (or internal library) should be used for DHCP.
'';
};
logLevel = mkOption {
type = types.enum [ "OFF" "ERR" "WARN" "INFO" "DEBUG" "TRACE" ];
default = "WARN";
description = ''
Set the default logging verbosity level.
'';
};
appendNameservers = mkOption { appendNameservers = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = []; default = [];