Skip to content
Permalink
Browse files

networkmanager module: support for dns and dhcp

This adds support for specifying the dhcp and dns options to
networkmanager. It just follows upstream's defaults if not specified so
there are no changes in behaviour unless the user requests it.

Especially the ```dns``` part is interesting as it allows us to do split
lookups when connected to a VPN.

Additional stuff

- remove deprecated `hostname`
- make loglevel configurable
- do not log to auditd if auditing is disabled
  • Loading branch information
peterhoeg committed Sep 22, 2019
1 parent d484f2b commit 5a49163e94b34f8a7e170a28566208b01e2cdc98
Showing with 12 additions and 2 deletions.
  1. +12 −2 nixos/modules/services/networking/networkmanager.nix
@@ -27,6 +27,7 @@ let
[logging]
level=${cfg.logLevel}
audit=${lib.boolToString config.security.audit.enable}
[connection]
ipv6.ip6-privacy=2
@@ -204,6 +205,14 @@ in {
'';
};

dns = mkOption {
type = types.enum [ "default" "dnsmasq" "none" ];
default = "default";
description = ''
Set the DNS (resolv.conf) processing mode.
'';
};

logLevel = mkOption {
type = types.enum [ "OFF" "ERR" "WARN" "INFO" "DEBUG" "TRACE" ];
default = "WARN";
@@ -508,8 +517,9 @@ in {

security.polkit.extraConfig = polkitConf;

services.dbus.packages =
optional cfg.enableStrongSwan pkgs.strongswanNM ++ cfg.packages;
services.dbus.packages = cfg.packages
++ optional cfg.enableStrongSwan pkgs.strongswanNM
++ optional (cfg.dns == "dnsmasq") dnsmasq;

services.udev.packages = cfg.packages;
};

0 comments on commit 5a49163

Please sign in to comment.
You can’t perform that action at this time.