Unverified Commit af59f218 authored by Florian Klink's avatar Florian Klink Committed by GitHub
Browse files

nixos/systemd-networkd: add new options for v260 (#513521)

parents 414b0bf4 12f55355
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -413,6 +413,10 @@ in
      [QuickFairQueueingClass]
      ${attrsToSection def.quickFairQueueingConfigClass}
    ''
    + optionalString (def.mobileNetworkConfig != { }) ''
      [MobileNetwork]
      ${attrsToSection def.mobileNetworkConfig}
    ''
    + flip concatMapStrings def.bridgeVLANs (x: ''
      [BridgeVLAN]
      ${attrsToSection x}
+58 −0
Original line number Diff line number Diff line
@@ -180,6 +180,12 @@ let
          "StatisticsBlockCoalesceSec"
          "MDI"
          "SR-IOVVirtualFunctions"
          "ScatterGather"
          "ScatterGatherFragmentList"
          "TCPECNSegmentationOffload"
          "TCPMangleIdSegmentationOffload"
          "GenericReceiveOffloadList"
          "GenericReceiveOffloadUDPForwarding"
        ])
        (assertValueOneOf "MACAddressPolicy" [
          "persistent"
@@ -271,6 +277,12 @@ let
          "auto"
        ])
        (assertRange "SR-IOVVirtualFunctions" 0 2147483647)
        (assertValueOneOf "ScatterGather" boolValues)
        (assertValueOneOf "ScatterGatherFragmentList" boolValues)
        (assertValueOneOf "TCPECNSegmentationOffload" boolValues)
        (assertValueOneOf "TCPMangleIdSegmentationOffload" boolValues)
        (assertValueOneOf "GenericReceiveOffloadList" boolValues)
        (assertValueOneOf "GenericReceiveOffloadUDPForwarding" boolValues)
      ];

      sectionSR-IOV = checkUnitConfig "SR-IOV" [
@@ -2412,6 +2424,38 @@ let
        (assertInt "PVID")
        (assertRange "PVID" 0 4094)
      ];

      sectionMobileNetwork = checkUnitConfig "MobileNetwork" [
        (assertOnlyFields [
          "APN"
          "AllowedAuthenticationMechanisms"
          "User"
          "Password"
          "IPFamily"
          "AllowRoaming"
          "PIN"
          "OperatorId"
          "RouteMetric"
          "UseGateway"
        ])
        (assertValuesSomeOfOr "AllowedAuthenticationMechanisms" [
          "none"
          "pap"
          "chap"
          "mschap"
          "mschapv2"
          "eap"
        ] "")
        (assertValueOneOf "IPFamily" [
          "ipv4"
          "ipv6"
          "both"
          "any"
        ])
        (assertValueOneOf "AllowRoaming" boolValues)
        (assertRange "RouteMetric" 0 4294967295)
        (assertValueOneOf "UseGateway" boolValues)
      ];
    };
  };

@@ -3746,6 +3790,20 @@ let
      '';
    };

    mobileNetworkConfig = mkOption {
      default = { };
      example = {
        APN = "access-point-name";
        AllowRoaming = false;
      };
      type = types.addCheck (types.attrsOf unitOption) check.network.sectionMobileNetwork;
      description = ''
        Each attribute in this set specifies an option in the
        `[MobileNetwork]` section of the unit.  See
        {manpage}`systemd.network(5)` for details.
      '';
    };

    name = mkOption {
      type = types.nullOr types.str;
      default = null;