about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2023-07-01 16:10:11 +0200
committerMaciej Krüger <mkg20001@gmail.com>2023-09-21 15:16:54 +0200
commitad0ca163e1338f37201f221075167d4e1797bca6 (patch)
tree16ce219319dda5f2196f5aba6994b8a54afd23e0 /nixos
parentdd7ea9090db29a0feed3acfc98cd3cbbbb13b8b5 (diff)
downloadnixlib-ad0ca163e1338f37201f221075167d4e1797bca6.tar
nixlib-ad0ca163e1338f37201f221075167d4e1797bca6.tar.gz
nixlib-ad0ca163e1338f37201f221075167d4e1797bca6.tar.bz2
nixlib-ad0ca163e1338f37201f221075167d4e1797bca6.tar.lz
nixlib-ad0ca163e1338f37201f221075167d4e1797bca6.tar.xz
nixlib-ad0ca163e1338f37201f221075167d4e1797bca6.tar.zst
nixlib-ad0ca163e1338f37201f221075167d4e1797bca6.zip
nixos/networkmanager: cleanup, fix example rendering
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/networkmanager.nix29
1 files changed, 14 insertions, 15 deletions
diff --git a/nixos/modules/services/networking/networkmanager.nix b/nixos/modules/services/networking/networkmanager.nix
index 6bc46a9a90e4..72f544c60525 100644
--- a/nixos/modules/services/networking/networkmanager.nix
+++ b/nixos/modules/services/networking/networkmanager.nix
@@ -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" '''
-
-                  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";
-          } ]'';
+            source = pkgs.writeText "upHook" '''
+              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";
+          } ]
+        '';
         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.
         '';
       };