about summary refs log tree commit diff
path: root/nixos/modules/system/boot
diff options
context:
space:
mode:
authorFélix Baylac-Jacqué <felix@alternativebit.fr>2020-02-29 19:34:48 +0100
committerFélix Baylac-Jacqué <felix@alternativebit.fr>2020-03-02 15:37:40 +0100
commit9897d83f5863cbf19ac9eab621b3997ae463d756 (patch)
treed9850669a515e2c49d1cf54219034a047387d57c /nixos/modules/system/boot
parent611d765b76d7e97f2618cb04a5d1c1604496cac9 (diff)
downloadnixlib-9897d83f5863cbf19ac9eab621b3997ae463d756.tar
nixlib-9897d83f5863cbf19ac9eab621b3997ae463d756.tar.gz
nixlib-9897d83f5863cbf19ac9eab621b3997ae463d756.tar.bz2
nixlib-9897d83f5863cbf19ac9eab621b3997ae463d756.tar.lz
nixlib-9897d83f5863cbf19ac9eab621b3997ae463d756.tar.xz
nixlib-9897d83f5863cbf19ac9eab621b3997ae463d756.tar.zst
nixlib-9897d83f5863cbf19ac9eab621b3997ae463d756.zip
nixos/networkd: test routingPolicyRules with a nixos vm test
Diffstat (limited to 'nixos/modules/system/boot')
-rw-r--r--nixos/modules/system/boot/networkd.nix23
1 files changed, 19 insertions, 4 deletions
diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix
index 44550b2f09cd..6dfbe66fc647 100644
--- a/nixos/modules/system/boot/networkd.nix
+++ b/nixos/modules/system/boot/networkd.nix
@@ -67,7 +67,12 @@ let
     (assertOnlyFields [
       "PrivateKeyFile" "ListenPort" "FwMark"
     ])
-    (assertRange "FwMark" 1 4294967295)
+    # The following check won't work on nix <= 2.2
+    # see https://github.com/NixOS/nix/pull/2378
+    #
+    # Add this again when we'll have drop the
+    # nix < 2.2 support.
+    # (assertRange "FwMark" 1 4294967295)
   ];
 
   # NOTE The PresharedKey directive is missing on purpose here, please
@@ -181,7 +186,12 @@ let
     (assertOnlyFields [
       "InterfaceId" "Independent"
     ])
-    (assertRange "InterfaceId" 1 4294967295)
+    # The following check won't work on nix <= 2.2
+    # see https://github.com/NixOS/nix/pull/2378
+    #
+    # Add this again when we'll have drop the
+    # nix < 2.2 support.
+    # (assertRange "InterfaceId" 1 4294967295)
     (assertValueOneOf "Independent" boolValues)
   ];
 
@@ -242,7 +252,12 @@ let
       "IPProtocol" "InvertRule" "Family"
     ])
     (assertRange "TypeOfService" 0 255)
-    (assertRange "FirewallMark" 1 4294967295)
+    # The following check won't work on nix <= 2.2
+    # see https://github.com/NixOS/nix/pull/2378
+    #
+    # Add this again when we'll have drop the
+    # nix < 2.2 support.
+    #  (assertRange "FirewallMark" 1 4294967295)
     (assertInt "Priority")
     (assertPort "SourcePort")
     (assertPort "DestinationPort")
@@ -554,7 +569,7 @@ let
     options = {
       routingPolicyRuleConfig = mkOption {
         default = { };
-        example = { routingPolicyRuleConfig = { Table = 10; IncomingInterface = "eth1"; } ;};
+        example = { routingPolicyRuleConfig = { Table = 10; IncomingInterface = "eth1"; Family = "both"; } ;};
         type = types.addCheck (types.attrsOf unitOption) checkRoutingPolicyRule;
         description = ''
           Each attribute in this set specifies an option in the