tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
networkd: add DHCPServer config section
Christian Albrecht
10 years ago
83a64cec
2307d245
+27
1 changed file
expand all
collapse all
unified
split
nixos
modules
system
boot
networkd.nix
+27
nixos/modules/system/boot/networkd.nix
···
131
(assertValueOneOf "RequestBroadcast" boolValues)
132
];
133
0
0
0
0
0
0
0
0
0
0
134
commonNetworkOptions = {
135
136
enable = mkOption {
···
343
'';
344
};
345
0
0
0
0
0
0
0
0
0
0
0
0
346
name = mkOption {
347
type = types.nullOr types.str;
348
default = null;
···
566
${optionalString (def.dhcpConfig != { }) ''
567
[DHCP]
568
${attrsToSection def.dhcpConfig}
0
0
0
0
0
569
570
''}
571
${flip concatMapStrings def.addresses (x: ''
···
131
(assertValueOneOf "RequestBroadcast" boolValues)
132
];
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
+
144
commonNetworkOptions = {
145
146
enable = mkOption {
···
353
'';
354
};
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
+
368
name = mkOption {
369
type = types.nullOr types.str;
370
default = null;
···
588
${optionalString (def.dhcpConfig != { }) ''
589
[DHCP]
590
${attrsToSection def.dhcpConfig}
591
+
592
+
''}
593
+
${optionalString (def.dhcpServerConfig != { }) ''
594
+
[DHCPServer]
595
+
${attrsToSection def.dhcpServerConfig}
596
597
''}
598
${flip concatMapStrings def.addresses (x: ''