Merge pull request #184340 from jmbaur/ipv6routeprefix

nixos/systemd.network: Add `IPv6RoutePrefix` options

authored by Florian Klink and committed by GitHub 087fa656 91fabbfb

+40
+40
nixos/modules/system/boot/networkd.nix
··· 879 (assertValueOneOf "OnLink" boolValues) 880 ]; 881 882 sectionDHCPServerStaticLease = checkUnitConfig "DHCPServerStaticLease" [ 883 (assertOnlyFields [ 884 "MACAddress" ··· 1242 }; 1243 }; 1244 1245 dhcpServerStaticLeaseOptions = { 1246 options = { 1247 dhcpServerStaticLeaseConfig = mkOption { ··· 1381 description = lib.mdDoc '' 1382 A list of ipv6Prefix sections to be added to the unit. See 1383 {manpage}`systemd.network(5)` for details. 1384 ''; 1385 }; 1386 ··· 1774 + flip concatMapStrings def.ipv6Prefixes (x: '' 1775 [IPv6Prefix] 1776 ${attrsToSection x.ipv6PrefixConfig} 1777 '') 1778 + flip concatMapStrings def.dhcpServerStaticLeases (x: '' 1779 [DHCPServerStaticLease]
··· 879 (assertValueOneOf "OnLink" boolValues) 880 ]; 881 882 + sectionIPv6RoutePrefix = checkUnitConfig "IPv6RoutePrefix" [ 883 + (assertOnlyFields [ 884 + "Route" 885 + "LifetimeSec" 886 + ]) 887 + (assertHasField "Route") 888 + (assertInt "LifetimeSec") 889 + ]; 890 + 891 sectionDHCPServerStaticLease = checkUnitConfig "DHCPServerStaticLease" [ 892 (assertOnlyFields [ 893 "MACAddress" ··· 1251 }; 1252 }; 1253 1254 + ipv6RoutePrefixOptions = { 1255 + options = { 1256 + ipv6RoutePrefixConfig = mkOption { 1257 + default = {}; 1258 + example = { Route = "fd00::/64"; }; 1259 + type = types.addCheck (types.attrsOf unitOption) check.network.sectionIPv6RoutePrefix; 1260 + description = '' 1261 + Each attribute in this set specifies an option in the 1262 + <literal>[IPv6RoutePrefix]</literal> section of the unit. See 1263 + <citerefentry><refentrytitle>systemd.network</refentrytitle> 1264 + <manvolnum>5</manvolnum></citerefentry> for details. 1265 + ''; 1266 + }; 1267 + }; 1268 + }; 1269 + 1270 dhcpServerStaticLeaseOptions = { 1271 options = { 1272 dhcpServerStaticLeaseConfig = mkOption { ··· 1406 description = lib.mdDoc '' 1407 A list of ipv6Prefix sections to be added to the unit. See 1408 {manpage}`systemd.network(5)` for details. 1409 + ''; 1410 + }; 1411 + 1412 + ipv6RoutePrefixes = mkOption { 1413 + default = []; 1414 + example = [ { Route = "fd00::/64"; LifetimeSec = 3600; } ]; 1415 + type = with types; listOf (submodule ipv6RoutePrefixOptions); 1416 + description = '' 1417 + A list of ipv6RoutePrefix sections to be added to the unit. See 1418 + <citerefentry><refentrytitle>systemd.network</refentrytitle> 1419 + <manvolnum>5</manvolnum></citerefentry> for details. 1420 ''; 1421 }; 1422 ··· 1810 + flip concatMapStrings def.ipv6Prefixes (x: '' 1811 [IPv6Prefix] 1812 ${attrsToSection x.ipv6PrefixConfig} 1813 + '') 1814 + + flip concatMapStrings def.ipv6RoutePrefixes (x: '' 1815 + [IPv6RoutePrefix] 1816 + ${attrsToSection x.ipv6RoutePrefixConfig} 1817 '') 1818 + flip concatMapStrings def.dhcpServerStaticLeases (x: '' 1819 [DHCPServerStaticLease]