summary refs log tree commit diff
path: root/nixos/modules/system/boot/networkd.nix
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@higgsboson.tk>2016-12-17 12:03:40 +0100
committerJörg Thalheim <joerg@higgsboson.tk>2016-12-17 15:23:34 +0100
commit579051fe66f3c41615309c17f96153e6dac0e10f (patch)
tree1188b6462d3d1dffab0457b92be2533edf2ca88a /nixos/modules/system/boot/networkd.nix
parentd49e0d5fa5c245ab4e8675ba7fd286d848484fb2 (diff)
downloadnixlib-579051fe66f3c41615309c17f96153e6dac0e10f.tar
nixlib-579051fe66f3c41615309c17f96153e6dac0e10f.tar.gz
nixlib-579051fe66f3c41615309c17f96153e6dac0e10f.tar.bz2
nixlib-579051fe66f3c41615309c17f96153e6dac0e10f.tar.lz
nixlib-579051fe66f3c41615309c17f96153e6dac0e10f.tar.xz
nixlib-579051fe66f3c41615309c17f96153e6dac0e10f.tar.zst
nixlib-579051fe66f3c41615309c17f96153e6dac0e10f.zip
networkd: add extraConfig to all units
networkd options are always correct or up to date. This option allows to by
pass type checking. It is also easier to write because examples can be just copy
and paste from manpages.
Diffstat (limited to 'nixos/modules/system/boot/networkd.nix')
-rw-r--r--nixos/modules/system/boot/networkd.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix
index 86237ea6ac7c..b828ad53dc58 100644
--- a/nixos/modules/system/boot/networkd.nix
+++ b/nixos/modules/system/boot/networkd.nix
@@ -165,6 +165,11 @@ let
       '';
     };
 
+    extraConfig = mkOption {
+      default = "";
+      type = types.lines;
+      description = "Extra configuration append to unit";
+    };
   };
 
   linkOptions = commonNetworkOptions // {
@@ -515,6 +520,8 @@ let
         ''
           [Link]
           ${attrsToSection def.linkConfig}
+
+          ${def.extraConfig}
         '';
     };
 
@@ -565,6 +572,7 @@ let
             ${attrsToSection def.bondConfig}
 
           ''}
+          ${def.extraConfig}
         '';
     };
 
@@ -603,6 +611,7 @@ let
             ${attrsToSection x.routeConfig}
 
           '')}
+          ${def.extraConfig}
         '';
     };