nixos/networkmanager: cleanup, fix example rendering

This commit is contained in:
Sandro Jäckel 2023-07-01 16:10:11 +02:00 committed by Maciej Krüger
parent dd7ea9090d
commit ad0ca163e1
No known key found for this signature in database
GPG Key ID: 0D948CE19CF49C5F

View File

@ -30,8 +30,7 @@ let
configFile = pkgs.writeText "NetworkManager.conf" (lib.concatStringsSep "\n" [ configFile = pkgs.writeText "NetworkManager.conf" (lib.concatStringsSep "\n" [
(mkSection "main" { (mkSection "main" {
plugins = "keyfile"; plugins = "keyfile";
dhcp = cfg.dhcp; inherit (cfg) dhcp dns;
dns = cfg.dns;
# If resolvconf is disabled that means that resolv.conf is managed by some other module. # If resolvconf is disabled that means that resolv.conf is managed by some other module.
rc-manager = rc-manager =
if config.networking.resolvconf.enable then "resolvconf" if config.networking.resolvconf.enable then "resolvconf"
@ -341,7 +340,6 @@ in
example = literalExpression '' example = literalExpression ''
[ { [ {
source = pkgs.writeText "upHook" ''' source = pkgs.writeText "upHook" '''
if [ "$2" != "up" ]; then if [ "$2" != "up" ]; then
logger "exit: event $2 != up" logger "exit: event $2 != up"
exit exit
@ -351,7 +349,8 @@ in
logger "Device $DEVICE_IFACE coming up" logger "Device $DEVICE_IFACE coming up"
'''; ''';
type = "basic"; type = "basic";
} ]''; } ]
'';
description = lib.mdDoc '' description = lib.mdDoc ''
A list of scripts which will be executed in response to network events. A list of scripts which will be executed in response to network events.
''; '';