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" [
(mkSection "main" {
plugins = "keyfile";
dhcp = cfg.dhcp;
dns = cfg.dns;
inherit (cfg) dhcp dns;
# If resolvconf is disabled that means that resolv.conf is managed by some other module.
rc-manager =
if config.networking.resolvconf.enable then "resolvconf"
@ -340,20 +339,20 @@ in
default = [ ];
example = literalExpression ''
[ {
source = pkgs.writeText "upHook" '''
source = pkgs.writeText "upHook" '''
if [ "$2" != "up" ]; then
logger "exit: event $2 != up"
exit
fi
if [ "$2" != "up" ]; then
logger "exit: event $2 != up"
exit
fi
# coreutils and iproute are in PATH too
logger "Device $DEVICE_IFACE coming up"
''';
type = "basic";
} ]'';
# coreutils and iproute are in PATH too
logger "Device $DEVICE_IFACE coming up"
''';
type = "basic";
} ]
'';
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.
'';
};