networkd: add DHCPServer config section

+27
+27
nixos/modules/system/boot/networkd.nix
··· 131 131 (assertValueOneOf "RequestBroadcast" boolValues) 132 132 ]; 133 133 134 + checkDhcpServer = checkUnitConfig "DHCPServer" [ 135 + (assertOnlyFields [ 136 + "PoolOffset" "PoolSize" "DefaultLeaseTimeSec" "MaxLeaseTimeSec" 137 + "EmitDNS" "DNS" "EmitNTP" "NTP" "EmitTimezone" "Timezone" 138 + ]) 139 + (assertValueOneOf "EmitDNS" boolValues) 140 + (assertValueOneOf "EmitNTP" boolValues) 141 + (assertValueOneOf "EmitTimezone" boolValues) 142 + ]; 143 + 134 144 commonNetworkOptions = { 135 145 136 146 enable = mkOption { ··· 343 353 ''; 344 354 }; 345 355 356 + dhcpServerConfig = mkOption { 357 + default = {}; 358 + example = { PoolOffset = 50; EmitDNS = false; }; 359 + type = types.addCheck (types.attrsOf unitOption) checkDhcpServer; 360 + description = '' 361 + Each attribute in this set specifies an option in the 362 + <literal>[DHCPServer]</literal> section of the unit. See 363 + <citerefentry><refentrytitle>systemd.network</refentrytitle> 364 + <manvolnum>5</manvolnum></citerefentry> for details. 365 + ''; 366 + }; 367 + 346 368 name = mkOption { 347 369 type = types.nullOr types.str; 348 370 default = null; ··· 566 588 ${optionalString (def.dhcpConfig != { }) '' 567 589 [DHCP] 568 590 ${attrsToSection def.dhcpConfig} 591 + 592 + ''} 593 + ${optionalString (def.dhcpServerConfig != { }) '' 594 + [DHCPServer] 595 + ${attrsToSection def.dhcpServerConfig} 569 596 570 597 ''} 571 598 ${flip concatMapStrings def.addresses (x: ''