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