···261261 # declarations from the ‘options’ attribute of containing option
262262 # declaration.
263263 optionSet = mkOptionType {
264264- name = /* builtins.trace "types.optionSet is deprecated; use types.submodule instead" */ "option set";
264264+ name = builtins.trace "types.optionSet is deprecated; use types.submodule instead" "option set";
265265 };
266266267267 # Augment the given type with an additional type check function.
+30-30
nixos/modules/config/users-groups.nix
···131131 };
132132133133 subUidRanges = mkOption {
134134- type = types.listOf types.optionSet;
134134+ type = with types; listOf (submodule subordinateUidRange);
135135 default = [];
136136 example = [
137137 { startUid = 1000; count = 1; }
138138 { startUid = 100001; count = 65534; }
139139 ];
140140- options = [ subordinateUidRange ];
141140 description = ''
142141 Subordinate user ids that user is allowed to use.
143142 They are set into <filename>/etc/subuid</filename> and are used
···146145 };
147146148147 subGidRanges = mkOption {
149149- type = types.listOf types.optionSet;
148148+ type = with types; listOf (submodule subordinateGidRange);
150149 default = [];
151150 example = [
152151 { startGid = 100; count = 1; }
153152 { startGid = 1001; count = 999; }
154153 ];
155155- options = [ subordinateGidRange ];
156154 description = ''
157155 Subordinate group ids that user is allowed to use.
158156 They are set into <filename>/etc/subgid</filename> and are used
···310308 };
311309312310 subordinateUidRange = {
313313- startUid = mkOption {
314314- type = types.int;
315315- description = ''
316316- Start of the range of subordinate user ids that user is
317317- allowed to use.
318318- '';
319319- };
320320- count = mkOption {
321321- type = types.int;
322322- default = 1;
323323- description = ''Count of subordinate user ids'';
311311+ options = {
312312+ startUid = mkOption {
313313+ type = types.int;
314314+ description = ''
315315+ Start of the range of subordinate user ids that user is
316316+ allowed to use.
317317+ '';
318318+ };
319319+ count = mkOption {
320320+ type = types.int;
321321+ default = 1;
322322+ description = ''Count of subordinate user ids'';
323323+ };
324324 };
325325 };
326326327327 subordinateGidRange = {
328328- startGid = mkOption {
329329- type = types.int;
330330- description = ''
331331- Start of the range of subordinate group ids that user is
332332- allowed to use.
333333- '';
334334- };
335335- count = mkOption {
336336- type = types.int;
337337- default = 1;
338338- description = ''Count of subordinate group ids'';
328328+ options = {
329329+ startGid = mkOption {
330330+ type = types.int;
331331+ description = ''
332332+ Start of the range of subordinate group ids that user is
333333+ allowed to use.
334334+ '';
335335+ };
336336+ count = mkOption {
337337+ type = types.int;
338338+ default = 1;
339339+ description = ''Count of subordinate group ids'';
340340+ };
339341 };
340342 };
341343···428430429431 users.users = mkOption {
430432 default = {};
431431- type = types.loaOf types.optionSet;
433433+ type = with types; loaOf (submodule userOpts);
432434 example = {
433435 alice = {
434436 uid = 1234;
···444446 Additional user accounts to be created automatically by the system.
445447 This can also be used to set options for root.
446448 '';
447447- options = [ userOpts ];
448449 };
449450450451 users.groups = mkOption {
···453454 { students.gid = 1001;
454455 hackers = { };
455456 };
456456- type = types.loaOf types.optionSet;
457457+ type = with types; loaOf (submodule groupOpts);
457458 description = ''
458459 Additional groups to be created automatically by the system.
459460 '';
460460- options = [ groupOpts ];
461461 };
462462463463 # FIXME: obsolete - will remove.
+1-2
nixos/modules/security/acme.nix
···129129130130 certs = mkOption {
131131 default = { };
132132- type = types.loaOf types.optionSet;
132132+ type = with types; loaOf (submodule certOpts);
133133 description = ''
134134 Attribute set of certificates to get signed and renewed.
135135 '';
136136- options = [ certOpts ];
137136 example = {
138137 "example.com" = {
139138 webroot = "/var/www/challenges/";
+1-2
nixos/modules/security/pam.nix
···386386387387 security.pam.services = mkOption {
388388 default = [];
389389- type = types.loaOf types.optionSet;
390390- options = [ pamOpts ];
389389+ type = with types; loaOf (submodule pamOpts);
391390 description =
392391 ''
393392 This option defines the PAM services. A service typically
+3-6
nixos/modules/services/backup/bacula.nix
···198198 description = ''
199199 This option defines director resources in Bacula File Daemon.
200200 '';
201201- type = types.attrsOf types.optionSet;
202202- options = [ directorOptions ];
201201+ type = with types; attrsOf (submodule directorOptions);
203202 };
204203205204 extraClientConfig = mkOption {
···253252 description = ''
254253 This option defines Director resources in Bacula Storage Daemon.
255254 '';
256256- type = types.attrsOf types.optionSet;
257257- options = [ directorOptions ];
255255+ type = with types; attrsOf (submodule directorOptions);
258256 };
259257260258 device = mkOption {
···262260 description = ''
263261 This option defines Device resources in Bacula Storage Daemon.
264262 '';
265265- type = types.attrsOf types.optionSet;
266266- options = [ deviceOptions ];
263263+ type = with types; attrsOf (submodule deviceOptions);
267264 };
268265269266 extraStorageConfig = mkOption {
···8181 { office1 = { model = "MFC-7860DW"; ip = "192.168.1.2"; };
8282 office2 = { model = "MFC-7860DW"; nodename = "BRW0080927AFBCE"; };
8383 };
8484- type = types.loaOf types.optionSet;
8484+ type = with types; loaOf (submodule netDeviceOpts);
8585 description = ''
8686 The list of network devices that will be registered against the brscan4
8787 sane backend.
8888 '';
8989- options = [ netDeviceOpts ];
9089 };
9190 };
9291···113112 ];
114113115114 };
116116-}115115+}
+35-33
nixos/modules/services/logging/logcheck.nix
···6262 };
63636464 ignoreOptions = {
6565- level = levelOption;
6565+ options = {
6666+ level = levelOption;
66676767- regex = mkOption {
6868- default = "";
6969- type = types.str;
7070- description = ''
7171- Regex specifying which log lines to ignore.
7272- '';
6868+ regex = mkOption {
6969+ default = "";
7070+ type = types.str;
7171+ description = ''
7272+ Regex specifying which log lines to ignore.
7373+ '';
7474+ };
7375 };
7476 };
75777678 ignoreCronOptions = {
7777- user = mkOption {
7878- default = "root";
7979- type = types.str;
8080- description = ''
8181- User that runs the cronjob.
8282- '';
8383- };
7979+ options = {
8080+ user = mkOption {
8181+ default = "root";
8282+ type = types.str;
8383+ description = ''
8484+ User that runs the cronjob.
8585+ '';
8686+ };
84878585- cmdline = mkOption {
8686- default = "";
8787- type = types.str;
8888- description = ''
8989- Command line for the cron job. Will be turned into a regex for the logcheck ignore rule.
9090- '';
9191- };
8888+ cmdline = mkOption {
8989+ default = "";
9090+ type = types.str;
9191+ description = ''
9292+ Command line for the cron job. Will be turned into a regex for the logcheck ignore rule.
9393+ '';
9494+ };
92959393- timeArgs = mkOption {
9494- default = null;
9595- type = types.nullOr (types.str);
9696- example = "02 06 * * *";
9797- description = ''
9898- "min hr dom mon dow" crontab time args, to auto-create a cronjob too.
9999- Leave at null to not do this and just add a logcheck ignore rule.
100100- '';
9696+ timeArgs = mkOption {
9797+ default = null;
9898+ type = types.nullOr (types.str);
9999+ example = "02 06 * * *";
100100+ description = ''
101101+ "min hr dom mon dow" crontab time args, to auto-create a cronjob too.
102102+ Leave at null to not do this and just add a logcheck ignore rule.
103103+ '';
104104+ };
101105 };
102106 };
103107···180184 description = ''
181185 This option defines extra ignore rules.
182186 '';
183183- type = types.loaOf types.optionSet;
184184- options = [ ignoreOptions ];
187187+ type = with types; loaOf (submodule ignoreOptions);
185188 };
186189187190 ignoreCron = mkOption {
···189192 description = ''
190193 This option defines extra ignore rules for cronjobs.
191194 '';
192192- type = types.loaOf types.optionSet;
193193- options = [ ignoreOptions ignoreCronOptions ];
195195+ type = with types; loaOf (submodule ignoreCronOptions);
194196 };
195197196198 extraGroups = mkOption {
+38-40
nixos/modules/services/misc/rippled.nix
···154154 };
155155156156 dbOptions = {
157157- type = mkOption {
158158- description = "Rippled database type.";
159159- type = types.enum ["rocksdb" "nudb"];
160160- default = "rocksdb";
161161- };
157157+ options = {
158158+ type = mkOption {
159159+ description = "Rippled database type.";
160160+ type = types.enum ["rocksdb" "nudb"];
161161+ default = "rocksdb";
162162+ };
162163163163- path = mkOption {
164164- description = "Location to store the database.";
165165- type = types.path;
166166- default = cfg.databasePath;
167167- };
164164+ path = mkOption {
165165+ description = "Location to store the database.";
166166+ type = types.path;
167167+ default = cfg.databasePath;
168168+ };
168169169169- compression = mkOption {
170170- description = "Whether to enable snappy compression.";
171171- type = types.nullOr types.bool;
172172- default = null;
173173- };
170170+ compression = mkOption {
171171+ description = "Whether to enable snappy compression.";
172172+ type = types.nullOr types.bool;
173173+ default = null;
174174+ };
174175175175- onlineDelete = mkOption {
176176- description = "Enable automatic purging of older ledger information.";
177177- type = types.addCheck (types.nullOr types.int) (v: v > 256);
178178- default = cfg.ledgerHistory;
179179- };
176176+ onlineDelete = mkOption {
177177+ description = "Enable automatic purging of older ledger information.";
178178+ type = types.addCheck (types.nullOr types.int) (v: v > 256);
179179+ default = cfg.ledgerHistory;
180180+ };
180181181181- advisoryDelete = mkOption {
182182- description = ''
183183- If set, then require administrative RPC call "can_delete"
184184- to enable online deletion of ledger records.
185185- '';
186186- type = types.nullOr types.bool;
187187- default = null;
188188- };
182182+ advisoryDelete = mkOption {
183183+ description = ''
184184+ If set, then require administrative RPC call "can_delete"
185185+ to enable online deletion of ledger records.
186186+ '';
187187+ type = types.nullOr types.bool;
188188+ default = null;
189189+ };
189190190190- extraOpts = mkOption {
191191- description = "Extra database options.";
192192- type = types.lines;
193193- default = "";
191191+ extraOpts = mkOption {
192192+ description = "Extra database options.";
193193+ type = types.lines;
194194+ default = "";
195195+ };
194196 };
195197 };
196198···213215214216 ports = mkOption {
215217 description = "Ports exposed by rippled";
216216- type = types.attrsOf types.optionSet;
217217- options = [portOptions];
218218+ type = with types; attrsOf (submodule portOptions);
218219 default = {
219220 rpc = {
220221 port = 5005;
···238239239240 nodeDb = mkOption {
240241 description = "Rippled main database options.";
241241- type = types.nullOr types.optionSet;
242242- options = dbOptions;
242242+ type = with types; nullOr (submodule dbOptions);
243243 default = {
244244 type = "rocksdb";
245245 extraOpts = ''
···254254255255 tempDb = mkOption {
256256 description = "Rippled temporary database options.";
257257- type = types.nullOr types.optionSet;
258258- options = dbOptions;
257257+ type = with types; nullOr (submodule dbOptions);
259258 default = null;
260259 };
261260262261 importDb = mkOption {
263262 description = "Settings for performing a one-time import.";
264264- type = types.nullOr types.optionSet;
265265- options = dbOptions;
263263+ type = with types; nullOr (submodule dbOptions);
266264 default = null;
267265 };
268266
+1-2
nixos/modules/services/monitoring/smartd.nix
···197197 devices = mkOption {
198198 default = [];
199199 example = [ { device = "/dev/sda"; } { device = "/dev/sdb"; options = "-d sat"; } ];
200200- type = types.listOf types.optionSet;
201201- options = [ smartdOpts ];
200200+ type = with types; listOf (submodule smartdOpts);
202201 description = "List of devices to monitor.";
203202 };
204203
+1-2
nixos/modules/services/monitoring/ups.nix
···169169 monitoring directly. These are usually attached to serial ports,
170170 but USB devices are also supported.
171171 '';
172172- type = types.attrsOf types.optionSet;
173173- options = [ upsOptions ];
172172+ type = with types; attrsOf (submodule upsOptions);
174173 };
175174176175 };
···88 options.services.tahoe = {
99 introducers = mkOption {
1010 default = {};
1111- type = types.loaOf types.optionSet;
1111+ type = with types; loaOf (submodule {
1212+ options = {
1313+ nickname = mkOption {
1414+ type = types.str;
1515+ description = ''
1616+ The nickname of this Tahoe introducer.
1717+ '';
1818+ };
1919+ tub.port = mkOption {
2020+ default = 3458;
2121+ type = types.int;
2222+ description = ''
2323+ The port on which the introducer will listen.
2424+ '';
2525+ };
2626+ tub.location = mkOption {
2727+ default = null;
2828+ type = types.nullOr types.str;
2929+ description = ''
3030+ The external location that the introducer should listen on.
3131+3232+ If specified, the port should be included.
3333+ '';
3434+ };
3535+ package = mkOption {
3636+ default = pkgs.tahoelafs;
3737+ defaultText = "pkgs.tahoelafs";
3838+ type = types.package;
3939+ example = literalExample "pkgs.tahoelafs";
4040+ description = ''
4141+ The package to use for the Tahoe LAFS daemon.
4242+ '';
4343+ };
4444+ };
4545+ });
1246 description = ''
1347 The Tahoe introducers.
1448 '';
1515- options = {
1616- nickname = mkOption {
1717- type = types.str;
1818- description = ''
1919- The nickname of this Tahoe introducer.
2020- '';
2121- };
2222- tub.port = mkOption {
2323- default = 3458;
2424- type = types.int;
2525- description = ''
2626- The port on which the introducer will listen.
2727- '';
2828- };
2929- tub.location = mkOption {
3030- default = null;
3131- type = types.nullOr types.str;
3232- description = ''
3333- The external location that the introducer should listen on.
3434-3535- If specified, the port should be included.
3636- '';
3737- };
3838- package = mkOption {
3939- default = pkgs.tahoelafs;
4040- defaultText = "pkgs.tahoelafs";
4141- type = types.package;
4242- example = literalExample "pkgs.tahoelafs";
4343- description = ''
4444- The package to use for the Tahoe LAFS daemon.
4545- '';
4646- };
4747- };
4849 };
4950 nodes = mkOption {
5051 default = {};
5151- type = types.loaOf types.optionSet;
5252- description = ''
5353- The Tahoe nodes.
5454- '';
5555- options = {
5656- nickname = mkOption {
5757- type = types.str;
5858- description = ''
5959- The nickname of this Tahoe node.
6060- '';
6161- };
6262- tub.port = mkOption {
6363- default = 3457;
6464- type = types.int;
6565- description = ''
6666- The port on which the tub will listen.
5252+ type = with types; loaOf (submodule {
5353+ options = {
5454+ nickname = mkOption {
5555+ type = types.str;
5656+ description = ''
5757+ The nickname of this Tahoe node.
5858+ '';
5959+ };
6060+ tub.port = mkOption {
6161+ default = 3457;
6262+ type = types.int;
6363+ description = ''
6464+ The port on which the tub will listen.
67656868- This is the correct setting to tweak if you want Tahoe's storage
6969- system to listen on a different port.
7070- '';
7171- };
7272- tub.location = mkOption {
7373- default = null;
7474- type = types.nullOr types.str;
7575- description = ''
7676- The external location that the node should listen on.
6666+ This is the correct setting to tweak if you want Tahoe's storage
6767+ system to listen on a different port.
6868+ '';
6969+ };
7070+ tub.location = mkOption {
7171+ default = null;
7272+ type = types.nullOr types.str;
7373+ description = ''
7474+ The external location that the node should listen on.
77757878- This is the setting to tweak if there are multiple interfaces
7979- and you want to alter which interface Tahoe is advertising.
7676+ This is the setting to tweak if there are multiple interfaces
7777+ and you want to alter which interface Tahoe is advertising.
80788181- If specified, the port should be included.
8282- '';
8383- };
8484- web.port = mkOption {
8585- default = 3456;
8686- type = types.int;
8787- description = ''
8888- The port on which the Web server will listen.
7979+ If specified, the port should be included.
8080+ '';
8181+ };
8282+ web.port = mkOption {
8383+ default = 3456;
8484+ type = types.int;
8585+ description = ''
8686+ The port on which the Web server will listen.
89879090- This is the correct setting to tweak if you want Tahoe's WUI to
9191- listen on a different port.
9292- '';
9393- };
9494- client.introducer = mkOption {
9595- default = null;
9696- type = types.nullOr types.str;
9797- description = ''
9898- The furl for a Tahoe introducer node.
8888+ This is the correct setting to tweak if you want Tahoe's WUI to
8989+ listen on a different port.
9090+ '';
9191+ };
9292+ client.introducer = mkOption {
9393+ default = null;
9494+ type = types.nullOr types.str;
9595+ description = ''
9696+ The furl for a Tahoe introducer node.
9997100100- Like all furls, keep this safe and don't share it.
101101- '';
102102- };
103103- client.helper = mkOption {
104104- default = null;
105105- type = types.nullOr types.str;
106106- description = ''
107107- The furl for a Tahoe helper node.
9898+ Like all furls, keep this safe and don't share it.
9999+ '';
100100+ };
101101+ client.helper = mkOption {
102102+ default = null;
103103+ type = types.nullOr types.str;
104104+ description = ''
105105+ The furl for a Tahoe helper node.
108106109109- Like all furls, keep this safe and don't share it.
110110- '';
111111- };
112112- client.shares.needed = mkOption {
113113- default = 3;
114114- type = types.int;
115115- description = ''
116116- The number of shares required to reconstitute a file.
117117- '';
118118- };
119119- client.shares.happy = mkOption {
120120- default = 7;
121121- type = types.int;
122122- description = ''
123123- The number of distinct storage nodes required to store
124124- a file.
125125- '';
126126- };
127127- client.shares.total = mkOption {
128128- default = 10;
129129- type = types.int;
130130- description = ''
131131- The number of shares required to store a file.
132132- '';
133133- };
134134- storage.enable = mkEnableOption "storage service";
135135- storage.reservedSpace = mkOption {
136136- default = "1G";
137137- type = types.str;
138138- description = ''
139139- The amount of filesystem space to not use for storage.
140140- '';
141141- };
142142- helper.enable = mkEnableOption "helper service";
143143- package = mkOption {
144144- default = pkgs.tahoelafs;
145145- defaultText = "pkgs.tahoelafs";
146146- type = types.package;
147147- example = literalExample "pkgs.tahoelafs";
148148- description = ''
149149- The package to use for the Tahoe LAFS daemon.
150150- '';
107107+ Like all furls, keep this safe and don't share it.
108108+ '';
109109+ };
110110+ client.shares.needed = mkOption {
111111+ default = 3;
112112+ type = types.int;
113113+ description = ''
114114+ The number of shares required to reconstitute a file.
115115+ '';
116116+ };
117117+ client.shares.happy = mkOption {
118118+ default = 7;
119119+ type = types.int;
120120+ description = ''
121121+ The number of distinct storage nodes required to store
122122+ a file.
123123+ '';
124124+ };
125125+ client.shares.total = mkOption {
126126+ default = 10;
127127+ type = types.int;
128128+ description = ''
129129+ The number of shares required to store a file.
130130+ '';
131131+ };
132132+ storage.enable = mkEnableOption "storage service";
133133+ storage.reservedSpace = mkOption {
134134+ default = "1G";
135135+ type = types.str;
136136+ description = ''
137137+ The amount of filesystem space to not use for storage.
138138+ '';
139139+ };
140140+ helper.enable = mkEnableOption "helper service";
141141+ package = mkOption {
142142+ default = pkgs.tahoelafs;
143143+ defaultText = "pkgs.tahoelafs";
144144+ type = types.package;
145145+ example = literalExample "pkgs.tahoelafs";
146146+ description = ''
147147+ The package to use for the Tahoe LAFS daemon.
148148+ '';
149149+ };
151150 };
152152- };
151151+ });
152152+ description = ''
153153+ The Tahoe nodes.
154154+ '';
153155 };
154156 };
155157 config = mkMerge [
+27-28
nixos/modules/services/networking/i2pd.nix
···187187188188 outTunnels = mkOption {
189189 default = {};
190190- type = with types; loaOf optionSet;
190190+ type = with types; loaOf (submodule (
191191+ { name, config, ... }: {
192192+ options = commonTunOpts name;
193193+ config = {
194194+ name = mkDefault name;
195195+ };
196196+ }
197197+ ));
191198 description = ''
192199 Connect to someone as a client and establish a local accept endpoint
193200 '';
194194- options = [ ({ name, config, ... }: {
195195- options = commonTunOpts name;
196196- config = {
197197- name = mkDefault name;
198198- };
199199- }) ];
200201 };
201202202203 inTunnels = mkOption {
203204 default = {};
204204- type = with types; loaOf optionSet;
205205+ type = with types; loaOf (submodule (
206206+ { name, config, ... }: {
207207+ options = {
208208+ inPort = mkOption {
209209+ type = types.int;
210210+ default = 0;
211211+ description = "Service port. Default to the tunnel's listen port.";
212212+ };
213213+ accessList = mkOption {
214214+ type = with types; listOf str;
215215+ default = [];
216216+ description = "I2P nodes that are allowed to connect to this service.";
217217+ };
218218+ } // commonTunOpts name;
219219+ config = {
220220+ name = mkDefault name;
221221+ };
222222+ }
223223+ ));
205224 description = ''
206225 Serve something on I2P network at port and delegate requests to address inPort.
207226 '';
208208- options = [ ({ name, config, ... }: {
209209-210210- options = {
211211- inPort = mkOption {
212212- type = types.int;
213213- default = 0;
214214- description = "Service port. Default to the tunnel's listen port.";
215215- };
216216- accessList = mkOption {
217217- type = with types; listOf str;
218218- default = [];
219219- description = "I2P nodes that are allowed to connect to this service.";
220220- };
221221- } // commonTunOpts name;
222222-223223- config = {
224224- name = mkDefault name;
225225- };
226226-227227- }) ];
228227 };
229228 };
230229 };
+15-15
nixos/modules/services/networking/nat.nix
···122122 };
123123124124 networking.nat.forwardPorts = mkOption {
125125- type = types.listOf types.optionSet;
126126- default = [];
127127- example = [ { sourcePort = 8080; destination = "10.0.0.1:80"; } ];
128128- options = {
129129- sourcePort = mkOption {
130130- type = types.int;
131131- example = 8080;
132132- description = "Source port of the external interface";
133133- };
125125+ type = with types; listOf (submodule {
126126+ options = {
127127+ sourcePort = mkOption {
128128+ type = types.int;
129129+ example = 8080;
130130+ description = "Source port of the external interface";
131131+ };
134132135135- destination = mkOption {
136136- type = types.str;
137137- example = "10.0.0.1:80";
138138- description = "Forward tcp connection to destination ip:port";
133133+ destination = mkOption {
134134+ type = types.str;
135135+ example = "10.0.0.1:80";
136136+ description = "Forward tcp connection to destination ip:port";
137137+ };
139138 };
140140- };
141141-139139+ });
140140+ default = [];
141141+ example = [ { sourcePort = 8080; destination = "10.0.0.1:80"; } ];
142142 description =
143143 ''
144144 List of forwarded ports from the external interface to
+40-38
nixos/modules/services/networking/openvpn.nix
···116116 attribute name.
117117 '';
118118119119- type = types.attrsOf types.optionSet;
119119+ type = with types; attrsOf (submodule {
120120121121- options = {
121121+ options = {
122122123123- config = mkOption {
124124- type = types.lines;
125125- description = ''
126126- Configuration of this OpenVPN instance. See
127127- <citerefentry><refentrytitle>openvpn</refentrytitle><manvolnum>8</manvolnum></citerefentry>
128128- for details.
129129- '';
130130- };
123123+ config = mkOption {
124124+ type = types.lines;
125125+ description = ''
126126+ Configuration of this OpenVPN instance. See
127127+ <citerefentry><refentrytitle>openvpn</refentrytitle><manvolnum>8</manvolnum></citerefentry>
128128+ for details.
129129+ '';
130130+ };
131131132132- up = mkOption {
133133- default = "";
134134- type = types.lines;
135135- description = ''
136136- Shell commands executed when the instance is starting.
137137- '';
138138- };
132132+ up = mkOption {
133133+ default = "";
134134+ type = types.lines;
135135+ description = ''
136136+ Shell commands executed when the instance is starting.
137137+ '';
138138+ };
139139140140- down = mkOption {
141141- default = "";
142142- type = types.lines;
143143- description = ''
144144- Shell commands executed when the instance is shutting down.
145145- '';
146146- };
140140+ down = mkOption {
141141+ default = "";
142142+ type = types.lines;
143143+ description = ''
144144+ Shell commands executed when the instance is shutting down.
145145+ '';
146146+ };
147147148148- autoStart = mkOption {
149149- default = true;
150150- type = types.bool;
151151- description = "Whether this OpenVPN instance should be started automatically.";
152152- };
148148+ autoStart = mkOption {
149149+ default = true;
150150+ type = types.bool;
151151+ description = "Whether this OpenVPN instance should be started automatically.";
152152+ };
153153+154154+ updateResolvConf = mkOption {
155155+ default = false;
156156+ type = types.bool;
157157+ description = ''
158158+ Use the script from the update-resolv-conf package to automatically
159159+ update resolv.conf with the DNS information provided by openvpn. The
160160+ script will be run after the "up" commands and before the "down" commands.
161161+ '';
162162+ };
153163154154- updateResolvConf = mkOption {
155155- default = false;
156156- type = types.bool;
157157- description = ''
158158- Use the script from the update-resolv-conf package to automatically
159159- update resolv.conf with the DNS information provided by openvpn. The
160160- script will be run after the "up" commands and before the "down" commands.
161161- '';
162164 };
163165164164- };
166166+ });
165167166168 };
167169
···129129 };
130130131131 listenAddresses = mkOption {
132132- type = types.listOf types.optionSet;
132132+ type = with types; listOf (submodule {
133133+ options = {
134134+ addr = mkOption {
135135+ type = types.nullOr types.str;
136136+ default = null;
137137+ description = ''
138138+ Host, IPv4 or IPv6 address to listen to.
139139+ '';
140140+ };
141141+ port = mkOption {
142142+ type = types.nullOr types.int;
143143+ default = null;
144144+ description = ''
145145+ Port to listen to.
146146+ '';
147147+ };
148148+ };
149149+ });
133150 default = [];
134151 example = [ { addr = "192.168.3.1"; port = 22; } { addr = "0.0.0.0"; port = 64022; } ];
135152 description = ''
···140157 NOTE: setting this option won't automatically enable given ports
141158 in firewall configuration.
142159 '';
143143- options = {
144144- addr = mkOption {
145145- type = types.nullOr types.str;
146146- default = null;
147147- description = ''
148148- Host, IPv4 or IPv6 address to listen to.
149149- '';
150150- };
151151- port = mkOption {
152152- type = types.nullOr types.int;
153153- default = null;
154154- description = ''
155155- Port to listen to.
156156- '';
157157- };
158158- };
159160 };
160161161162 passwordAuthentication = mkOption {
+101-102
nixos/modules/services/networking/supplicant.nix
···7575 options = {
76767777 networking.supplicant = mkOption {
7878- type = types.attrsOf types.optionSet;
7878+ type = with types; attrsOf (submodule {
7979+ options = {
8080+8181+ configFile = {
8282+8383+ path = mkOption {
8484+ type = types.path;
8585+ example = literalExample "/etc/wpa_supplicant.conf";
8686+ description = ''
8787+ External <literal>wpa_supplicant.conf</literal> configuration file.
8888+ The configuration options defined declaratively within <literal>networking.supplicant</literal> have
8989+ precedence over options defined in <literal>configFile</literal>.
9090+ '';
9191+ };
9292+9393+ writable = mkOption {
9494+ type = types.bool;
9595+ default = false;
9696+ description = ''
9797+ Whether the configuration file at <literal>configFile.path</literal> should be written to by
9898+ <literal>wpa_supplicant</literal>.
9999+ '';
100100+ };
101101+102102+ };
103103+104104+ extraConf = mkOption {
105105+ type = types.lines;
106106+ default = "";
107107+ example = ''
108108+ ap_scan=1
109109+ device_name=My-NixOS-Device
110110+ device_type=1-0050F204-1
111111+ driver_param=use_p2p_group_interface=1
112112+ disable_scan_offload=1
113113+ p2p_listen_reg_class=81
114114+ p2p_listen_channel=1
115115+ p2p_oper_reg_class=81
116116+ p2p_oper_channel=1
117117+ manufacturer=NixOS
118118+ model_name=NixOS_Unstable
119119+ model_number=2015
120120+ '';
121121+ description = ''
122122+ Configuration options for <literal>wpa_supplicant.conf</literal>.
123123+ Options defined here have precedence over options in <literal>configFile</literal>.
124124+ NOTE: Do not write sensitive data into <literal>extraConf</literal> as it will
125125+ be world-readable in the <literal>nix-store</literal>. For sensitive information
126126+ use the <literal>configFile</literal> instead.
127127+ '';
128128+ };
129129+130130+ extraCmdArgs = mkOption {
131131+ type = types.str;
132132+ default = "";
133133+ example = "-e/var/run/wpa_supplicant/entropy.bin";
134134+ description =
135135+ "Command line arguments to add when executing <literal>wpa_supplicant</literal>.";
136136+ };
137137+138138+ driver = mkOption {
139139+ type = types.nullOr types.str;
140140+ default = "nl80211,wext";
141141+ description = "Force a specific wpa_supplicant driver.";
142142+ };
143143+144144+ bridge = mkOption {
145145+ type = types.str;
146146+ default = "";
147147+ description = "Name of the bridge interface that wpa_supplicant should listen at.";
148148+ };
149149+150150+ userControlled = {
151151+152152+ enable = mkOption {
153153+ type = types.bool;
154154+ default = false;
155155+ description = ''
156156+ Allow normal users to control wpa_supplicant through wpa_gui or wpa_cli.
157157+ This is useful for laptop users that switch networks a lot and don't want
158158+ to depend on a large package such as NetworkManager just to pick nearby
159159+ access points.
160160+ '';
161161+ };
162162+163163+ socketDir = mkOption {
164164+ type = types.str;
165165+ default = "/var/run/wpa_supplicant";
166166+ description = "Directory of sockets for controlling wpa_supplicant.";
167167+ };
168168+169169+ group = mkOption {
170170+ type = types.str;
171171+ default = "wheel";
172172+ example = "network";
173173+ description = "Members of this group can control wpa_supplicant.";
174174+ };
175175+176176+ };
177177+ };
178178+ });
7917980180 default = { };
81181···108208 <literal>DBUS</literal> defines a device-unrelated <command>wpa_supplicant</command>
109209 service that can be accessed through <literal>D-Bus</literal>.
110210 '';
111111-112112- options = {
113113-114114- configFile = {
115115-116116- path = mkOption {
117117- type = types.path;
118118- example = literalExample "/etc/wpa_supplicant.conf";
119119- description = ''
120120- External <literal>wpa_supplicant.conf</literal> configuration file.
121121- The configuration options defined declaratively within <literal>networking.supplicant</literal> have
122122- precedence over options defined in <literal>configFile</literal>.
123123- '';
124124- };
125125-126126- writable = mkOption {
127127- type = types.bool;
128128- default = false;
129129- description = ''
130130- Whether the configuration file at <literal>configFile.path</literal> should be written to by
131131- <literal>wpa_supplicant</literal>.
132132- '';
133133- };
134134-135135- };
136136-137137- extraConf = mkOption {
138138- type = types.lines;
139139- default = "";
140140- example = ''
141141- ap_scan=1
142142- device_name=My-NixOS-Device
143143- device_type=1-0050F204-1
144144- driver_param=use_p2p_group_interface=1
145145- disable_scan_offload=1
146146- p2p_listen_reg_class=81
147147- p2p_listen_channel=1
148148- p2p_oper_reg_class=81
149149- p2p_oper_channel=1
150150- manufacturer=NixOS
151151- model_name=NixOS_Unstable
152152- model_number=2015
153153- '';
154154- description = ''
155155- Configuration options for <literal>wpa_supplicant.conf</literal>.
156156- Options defined here have precedence over options in <literal>configFile</literal>.
157157- NOTE: Do not write sensitive data into <literal>extraConf</literal> as it will
158158- be world-readable in the <literal>nix-store</literal>. For sensitive information
159159- use the <literal>configFile</literal> instead.
160160- '';
161161- };
162162-163163- extraCmdArgs = mkOption {
164164- type = types.str;
165165- default = "";
166166- example = "-e/var/run/wpa_supplicant/entropy.bin";
167167- description =
168168- "Command line arguments to add when executing <literal>wpa_supplicant</literal>.";
169169- };
170170-171171- driver = mkOption {
172172- type = types.nullOr types.str;
173173- default = "nl80211,wext";
174174- description = "Force a specific wpa_supplicant driver.";
175175- };
176176-177177- bridge = mkOption {
178178- type = types.str;
179179- default = "";
180180- description = "Name of the bridge interface that wpa_supplicant should listen at.";
181181- };
182182-183183- userControlled = {
184184-185185- enable = mkOption {
186186- type = types.bool;
187187- default = false;
188188- description = ''
189189- Allow normal users to control wpa_supplicant through wpa_gui or wpa_cli.
190190- This is useful for laptop users that switch networks a lot and don't want
191191- to depend on a large package such as NetworkManager just to pick nearby
192192- access points.
193193- '';
194194- };
195195-196196- socketDir = mkOption {
197197- type = types.str;
198198- default = "/var/run/wpa_supplicant";
199199- description = "Directory of sockets for controlling wpa_supplicant.";
200200- };
201201-202202- group = mkOption {
203203- type = types.str;
204204- default = "wheel";
205205- example = "network";
206206- description = "Members of this group can control wpa_supplicant.";
207207- };
208208-209209- };
210210-211211- };
212211213212 };
214213
+79-77
nixos/modules/services/networking/tinc.nix
···18181919 networks = mkOption {
2020 default = { };
2121- type = types.loaOf types.optionSet;
2222- description = ''
2323- Defines the tinc networks which will be started.
2424- Each network invokes a different daemon.
2525- '';
2626- options = {
2121+ type = with types; loaOf (submodule {
2222+ options = {
27232828- extraConfig = mkOption {
2929- default = "";
3030- type = types.lines;
3131- description = ''
3232- Extra lines to add to the tinc service configuration file.
3333- '';
3434- };
2424+ extraConfig = mkOption {
2525+ default = "";
2626+ type = types.lines;
2727+ description = ''
2828+ Extra lines to add to the tinc service configuration file.
2929+ '';
3030+ };
35313636- name = mkOption {
3737- default = null;
3838- type = types.nullOr types.str;
3939- description = ''
4040- The name of the node which is used as an identifier when communicating
4141- with the remote nodes in the mesh. If null then the hostname of the system
4242- is used.
4343- '';
4444- };
3232+ name = mkOption {
3333+ default = null;
3434+ type = types.nullOr types.str;
3535+ description = ''
3636+ The name of the node which is used as an identifier when communicating
3737+ with the remote nodes in the mesh. If null then the hostname of the system
3838+ is used.
3939+ '';
4040+ };
45414646- ed25519PrivateKeyFile = mkOption {
4747- default = null;
4848- type = types.nullOr types.path;
4949- description = ''
5050- Path of the private ed25519 keyfile.
5151- '';
5252- };
4242+ ed25519PrivateKeyFile = mkOption {
4343+ default = null;
4444+ type = types.nullOr types.path;
4545+ description = ''
4646+ Path of the private ed25519 keyfile.
4747+ '';
4848+ };
53495454- debugLevel = mkOption {
5555- default = 0;
5656- type = types.addCheck types.int (l: l >= 0 && l <= 5);
5757- description = ''
5858- The amount of debugging information to add to the log. 0 means little
5959- logging while 5 is the most logging. <command>man tincd</command> for
6060- more details.
6161- '';
6262- };
5050+ debugLevel = mkOption {
5151+ default = 0;
5252+ type = types.addCheck types.int (l: l >= 0 && l <= 5);
5353+ description = ''
5454+ The amount of debugging information to add to the log. 0 means little
5555+ logging while 5 is the most logging. <command>man tincd</command> for
5656+ more details.
5757+ '';
5858+ };
63596464- hosts = mkOption {
6565- default = { };
6666- type = types.loaOf types.lines;
6767- description = ''
6868- The name of the host in the network as well as the configuration for that host.
6969- This name should only contain alphanumerics and underscores.
7070- '';
7171- };
6060+ hosts = mkOption {
6161+ default = { };
6262+ type = types.loaOf types.lines;
6363+ description = ''
6464+ The name of the host in the network as well as the configuration for that host.
6565+ This name should only contain alphanumerics and underscores.
6666+ '';
6767+ };
72687373- interfaceType = mkOption {
7474- default = "tun";
7575- type = types.addCheck types.str (n: n == "tun" || n == "tap");
7676- description = ''
7777- The type of virtual interface used for the network connection
7878- '';
7979- };
6969+ interfaceType = mkOption {
7070+ default = "tun";
7171+ type = types.addCheck types.str (n: n == "tun" || n == "tap");
7272+ description = ''
7373+ The type of virtual interface used for the network connection
7474+ '';
7575+ };
80768181- listenAddress = mkOption {
8282- default = null;
8383- type = types.nullOr types.str;
8484- description = ''
8585- The ip adress to bind to.
8686- '';
8787- };
7777+ listenAddress = mkOption {
7878+ default = null;
7979+ type = types.nullOr types.str;
8080+ description = ''
8181+ The ip adress to bind to.
8282+ '';
8383+ };
88848989- package = mkOption {
9090- type = types.package;
9191- default = pkgs.tinc_pre;
9292- defaultText = "pkgs.tinc_pre";
9393- description = ''
9494- The package to use for the tinc daemon's binary.
9595- '';
9696- };
8585+ package = mkOption {
8686+ type = types.package;
8787+ default = pkgs.tinc_pre;
8888+ defaultText = "pkgs.tinc_pre";
8989+ description = ''
9090+ The package to use for the tinc daemon's binary.
9191+ '';
9292+ };
97939898- chroot = mkOption {
9999- default = true;
100100- type = types.bool;
101101- description = ''
102102- Change process root directory to the directory where the config file is located (/etc/tinc/netname/), for added security.
103103- The chroot is performed after all the initialization is done, after writing pid files and opening network sockets.
9494+ chroot = mkOption {
9595+ default = true;
9696+ type = types.bool;
9797+ description = ''
9898+ Change process root directory to the directory where the config file is located (/etc/tinc/netname/), for added security.
9999+ The chroot is performed after all the initialization is done, after writing pid files and opening network sockets.
104100105105- Note that tinc can't run scripts anymore (such as tinc-down or host-up), unless it is setup to be runnable inside chroot environment.
106106- '';
101101+ Note that tinc can't run scripts anymore (such as tinc-down or host-up), unless it is setup to be runnable inside chroot environment.
102102+ '';
103103+ };
107104 };
108108- };
105105+ });
106106+107107+ description = ''
108108+ Defines the tinc networks which will be started.
109109+ Each network invokes a different daemon.
110110+ '';
109111 };
110112 };
111113
+55-53
nixos/modules/services/networking/xinetd.nix
···6565 A list of services provided by xinetd.
6666 '';
67676868- type = types.listOf types.optionSet;
6868+ type = with types; listOf (submodule ({
69697070- options = {
7070+ options = {
71717272- name = mkOption {
7373- type = types.string;
7474- example = "login";
7575- description = "Name of the service.";
7676- };
7272+ name = mkOption {
7373+ type = types.string;
7474+ example = "login";
7575+ description = "Name of the service.";
7676+ };
77777878- protocol = mkOption {
7979- type = types.string;
8080- default = "tcp";
8181- description =
8282- "Protocol of the service. Usually <literal>tcp</literal> or <literal>udp</literal>.";
8383- };
7878+ protocol = mkOption {
7979+ type = types.string;
8080+ default = "tcp";
8181+ description =
8282+ "Protocol of the service. Usually <literal>tcp</literal> or <literal>udp</literal>.";
8383+ };
84848585- port = mkOption {
8686- type = types.int;
8787- default = 0;
8888- example = 123;
8989- description = "Port number of the service.";
9090- };
8585+ port = mkOption {
8686+ type = types.int;
8787+ default = 0;
8888+ example = 123;
8989+ description = "Port number of the service.";
9090+ };
91919292- user = mkOption {
9393- type = types.string;
9494- default = "nobody";
9595- description = "User account for the service";
9696- };
9292+ user = mkOption {
9393+ type = types.string;
9494+ default = "nobody";
9595+ description = "User account for the service";
9696+ };
97979898- server = mkOption {
9999- type = types.string;
100100- example = "/foo/bin/ftpd";
101101- description = "Path of the program that implements the service.";
102102- };
9898+ server = mkOption {
9999+ type = types.string;
100100+ example = "/foo/bin/ftpd";
101101+ description = "Path of the program that implements the service.";
102102+ };
103103104104- serverArgs = mkOption {
105105- type = types.string;
106106- default = "";
107107- description = "Command-line arguments for the server program.";
108108- };
104104+ serverArgs = mkOption {
105105+ type = types.string;
106106+ default = "";
107107+ description = "Command-line arguments for the server program.";
108108+ };
109109110110- flags = mkOption {
111111- type = types.string;
112112- default = "";
113113- description = "";
114114- };
110110+ flags = mkOption {
111111+ type = types.string;
112112+ default = "";
113113+ description = "";
114114+ };
115115116116- unlisted = mkOption {
117117- type = types.bool;
118118- default = false;
119119- description = ''
120120- Whether this server is listed in
121121- <filename>/etc/services</filename>. If so, the port
122122- number can be omitted.
123123- '';
124124- };
116116+ unlisted = mkOption {
117117+ type = types.bool;
118118+ default = false;
119119+ description = ''
120120+ Whether this server is listed in
121121+ <filename>/etc/services</filename>. If so, the port
122122+ number can be omitted.
123123+ '';
124124+ };
125125+126126+ extraConfig = mkOption {
127127+ type = types.string;
128128+ default = "";
129129+ description = "Extra configuration-lines added to the section of the service.";
130130+ };
125131126126- extraConfig = mkOption {
127127- type = types.string;
128128- default = "";
129129- description = "Extra configuration-lines added to the section of the service.";
130132 };
131133132132- };
134134+ }));
133135134136 };
135137
+1-2
nixos/modules/services/web-servers/winstone.nix
···113113 options = {
114114 services.winstone = mkOption {
115115 default = {};
116116- type = types.attrsOf types.optionSet;
117117- options = [ winstoneOpts ];
116116+ type = with types; attrsOf (submodule winstoneOpts);
118117 description = ''
119118 Defines independent Winstone services, each serving one WAR-file.
120119 '';
+1-2
nixos/modules/services/web-servers/zope2.nix
···74747575 services.zope2.instances = mkOption {
7676 default = {};
7777- type = types.loaOf types.optionSet;
7777+ type = with types; loaOf (submodule zope2Opts);
7878 example = literalExample ''
7979 {
8080 plone01 = {
···9696 }
9797 '';
9898 description = "zope2 instances to be created automaticaly by the system.";
9999- options = [ zope2Opts ];
10099 };
101100 };
102101
+39-39
nixos/modules/system/boot/loader/grub/grub.nix
···131131 to the respective devices corresponding to those partitions.
132132 '';
133133134134- type = types.listOf types.optionSet;
134134+ type = with types; listOf (submodule {
135135+ options = {
135136136136- options = {
137137+ path = mkOption {
138138+ example = "/boot1";
139139+ type = types.str;
140140+ description = ''
141141+ The path to the boot directory where GRUB will be written. Generally
142142+ this boot path should double as an EFI path.
143143+ '';
144144+ };
137145138138- path = mkOption {
139139- example = "/boot1";
140140- type = types.str;
141141- description = ''
142142- The path to the boot directory where GRUB will be written. Generally
143143- this boot path should double as an EFI path.
144144- '';
145145- };
146146+ efiSysMountPoint = mkOption {
147147+ default = null;
148148+ example = "/boot1/efi";
149149+ type = types.nullOr types.str;
150150+ description = ''
151151+ The path to the efi system mount point. Usually this is the same
152152+ partition as the above path and can be left as null.
153153+ '';
154154+ };
146155147147- efiSysMountPoint = mkOption {
148148- default = null;
149149- example = "/boot1/efi";
150150- type = types.nullOr types.str;
151151- description = ''
152152- The path to the efi system mount point. Usually this is the same
153153- partition as the above path and can be left as null.
154154- '';
155155- };
156156+ efiBootloaderId = mkOption {
157157+ default = null;
158158+ example = "NixOS-fsid";
159159+ type = types.nullOr types.str;
160160+ description = ''
161161+ The id of the bootloader to store in efi nvram.
162162+ The default is to name it NixOS and append the path or efiSysMountPoint.
163163+ This is only used if <literal>boot.loader.efi.canTouchEfiVariables</literal> is true.
164164+ '';
165165+ };
156166157157- efiBootloaderId = mkOption {
158158- default = null;
159159- example = "NixOS-fsid";
160160- type = types.nullOr types.str;
161161- description = ''
162162- The id of the bootloader to store in efi nvram.
163163- The default is to name it NixOS and append the path or efiSysMountPoint.
164164- This is only used if <literal>boot.loader.efi.canTouchEfiVariables</literal> is true.
165165- '';
166166- };
167167+ devices = mkOption {
168168+ default = [ ];
169169+ example = [ "/dev/sda" "/dev/sdb" ];
170170+ type = types.listOf types.str;
171171+ description = ''
172172+ The path to the devices which will have the GRUB MBR written.
173173+ Note these are typically device paths and not paths to partitions.
174174+ '';
175175+ };
167176168168- devices = mkOption {
169169- default = [ ];
170170- example = [ "/dev/sda" "/dev/sdb" ];
171171- type = types.listOf types.str;
172172- description = ''
173173- The path to the devices which will have the GRUB MBR written.
174174- Note these are typically device paths and not paths to partitions.
175175- '';
176177 };
177177-178178- };
178178+ });
179179 };
180180181181 configurationName = mkOption {
+136-136
nixos/modules/system/boot/luksroot.nix
···236236 <filename>/dev/mapper/<replaceable>name</replaceable></filename>.
237237 '';
238238239239- type = types.loaOf types.optionSet;
239239+ type = with types; loaOf (submodule (
240240+ { name, ... }: { options = {
240241241241- options = { name, ... }: { options = {
242242-243243- name = mkOption {
244244- visible = false;
245245- default = name;
246246- example = "luksroot";
247247- type = types.str;
248248- description = "Name of the unencrypted device in <filename>/dev/mapper</filename>.";
249249- };
242242+ name = mkOption {
243243+ visible = false;
244244+ default = name;
245245+ example = "luksroot";
246246+ type = types.str;
247247+ description = "Name of the unencrypted device in <filename>/dev/mapper</filename>.";
248248+ };
250249251251- device = mkOption {
252252- example = "/dev/disk/by-uuid/430e9eff-d852-4f68-aa3b-2fa3599ebe08";
253253- type = types.str;
254254- description = "Path of the underlying encrypted block device.";
255255- };
250250+ device = mkOption {
251251+ example = "/dev/disk/by-uuid/430e9eff-d852-4f68-aa3b-2fa3599ebe08";
252252+ type = types.str;
253253+ description = "Path of the underlying encrypted block device.";
254254+ };
256255257257- header = mkOption {
258258- default = null;
259259- example = "/root/header.img";
260260- type = types.nullOr types.str;
261261- description = ''
262262- The name of the file or block device that
263263- should be used as header for the encrypted device.
264264- '';
265265- };
256256+ header = mkOption {
257257+ default = null;
258258+ example = "/root/header.img";
259259+ type = types.nullOr types.str;
260260+ description = ''
261261+ The name of the file or block device that
262262+ should be used as header for the encrypted device.
263263+ '';
264264+ };
266265267267- keyFile = mkOption {
268268- default = null;
269269- example = "/dev/sdb1";
270270- type = types.nullOr types.str;
271271- description = ''
272272- The name of the file (can be a raw device or a partition) that
273273- should be used as the decryption key for the encrypted device. If
274274- not specified, you will be prompted for a passphrase instead.
275275- '';
276276- };
266266+ keyFile = mkOption {
267267+ default = null;
268268+ example = "/dev/sdb1";
269269+ type = types.nullOr types.str;
270270+ description = ''
271271+ The name of the file (can be a raw device or a partition) that
272272+ should be used as the decryption key for the encrypted device. If
273273+ not specified, you will be prompted for a passphrase instead.
274274+ '';
275275+ };
277276278278- keyFileSize = mkOption {
279279- default = null;
280280- example = 4096;
281281- type = types.nullOr types.int;
282282- description = ''
283283- The size of the key file. Use this if only the beginning of the
284284- key file should be used as a key (often the case if a raw device
285285- or partition is used as key file). If not specified, the whole
286286- <literal>keyFile</literal> will be used decryption, instead of just
287287- the first <literal>keyFileSize</literal> bytes.
288288- '';
289289- };
277277+ keyFileSize = mkOption {
278278+ default = null;
279279+ example = 4096;
280280+ type = types.nullOr types.int;
281281+ description = ''
282282+ The size of the key file. Use this if only the beginning of the
283283+ key file should be used as a key (often the case if a raw device
284284+ or partition is used as key file). If not specified, the whole
285285+ <literal>keyFile</literal> will be used decryption, instead of just
286286+ the first <literal>keyFileSize</literal> bytes.
287287+ '';
288288+ };
290289291291- # FIXME: get rid of this option.
292292- preLVM = mkOption {
293293- default = true;
294294- type = types.bool;
295295- description = "Whether the luksOpen will be attempted before LVM scan or after it.";
296296- };
290290+ # FIXME: get rid of this option.
291291+ preLVM = mkOption {
292292+ default = true;
293293+ type = types.bool;
294294+ description = "Whether the luksOpen will be attempted before LVM scan or after it.";
295295+ };
297296298298- allowDiscards = mkOption {
299299- default = false;
300300- type = types.bool;
301301- description = ''
302302- Whether to allow TRIM requests to the underlying device. This option
303303- has security implications; please read the LUKS documentation before
304304- activating it.
305305- '';
306306- };
297297+ allowDiscards = mkOption {
298298+ default = false;
299299+ type = types.bool;
300300+ description = ''
301301+ Whether to allow TRIM requests to the underlying device. This option
302302+ has security implications; please read the LUKS documentation before
303303+ activating it.
304304+ '';
305305+ };
307306308308- yubikey = mkOption {
309309- default = null;
310310- type = types.nullOr types.optionSet;
311311- description = ''
312312- The options to use for this LUKS device in Yubikey-PBA.
313313- If null (the default), Yubikey-PBA will be disabled for this device.
314314- '';
307307+ yubikey = mkOption {
308308+ default = null;
309309+ description = ''
310310+ The options to use for this LUKS device in Yubikey-PBA.
311311+ If null (the default), Yubikey-PBA will be disabled for this device.
312312+ '';
315313316316- options = {
317317- twoFactor = mkOption {
318318- default = true;
319319- type = types.bool;
320320- description = "Whether to use a passphrase and a Yubikey (true), or only a Yubikey (false).";
321321- };
314314+ type = with types; nullOr (submodule {
315315+ options = {
316316+ twoFactor = mkOption {
317317+ default = true;
318318+ type = types.bool;
319319+ description = "Whether to use a passphrase and a Yubikey (true), or only a Yubikey (false).";
320320+ };
322321323323- slot = mkOption {
324324- default = 2;
325325- type = types.int;
326326- description = "Which slot on the Yubikey to challenge.";
327327- };
322322+ slot = mkOption {
323323+ default = 2;
324324+ type = types.int;
325325+ description = "Which slot on the Yubikey to challenge.";
326326+ };
328327329329- saltLength = mkOption {
330330- default = 16;
331331- type = types.int;
332332- description = "Length of the new salt in byte (64 is the effective maximum).";
333333- };
328328+ saltLength = mkOption {
329329+ default = 16;
330330+ type = types.int;
331331+ description = "Length of the new salt in byte (64 is the effective maximum).";
332332+ };
334333335335- keyLength = mkOption {
336336- default = 64;
337337- type = types.int;
338338- description = "Length of the LUKS slot key derived with PBKDF2 in byte.";
339339- };
334334+ keyLength = mkOption {
335335+ default = 64;
336336+ type = types.int;
337337+ description = "Length of the LUKS slot key derived with PBKDF2 in byte.";
338338+ };
340339341341- iterationStep = mkOption {
342342- default = 0;
343343- type = types.int;
344344- description = "How much the iteration count for PBKDF2 is increased at each successful authentication.";
345345- };
340340+ iterationStep = mkOption {
341341+ default = 0;
342342+ type = types.int;
343343+ description = "How much the iteration count for PBKDF2 is increased at each successful authentication.";
344344+ };
346345347347- gracePeriod = mkOption {
348348- default = 2;
349349- type = types.int;
350350- description = "Time in seconds to wait before attempting to find the Yubikey.";
351351- };
346346+ gracePeriod = mkOption {
347347+ default = 2;
348348+ type = types.int;
349349+ description = "Time in seconds to wait before attempting to find the Yubikey.";
350350+ };
352351353353- ramfsMountPoint = mkOption {
354354- default = "/crypt-ramfs";
355355- type = types.str;
356356- description = "Path where the ramfs used to update the LUKS key will be mounted during early boot.";
357357- };
352352+ ramfsMountPoint = mkOption {
353353+ default = "/crypt-ramfs";
354354+ type = types.str;
355355+ description = "Path where the ramfs used to update the LUKS key will be mounted during early boot.";
356356+ };
358357359359- /* TODO: Add to the documentation of the current module:
358358+ /* TODO: Add to the documentation of the current module:
360359361361- Options related to the storing the salt.
362362- */
363363- storage = {
364364- device = mkOption {
365365- default = "/dev/sda1";
366366- type = types.path;
367367- description = ''
368368- An unencrypted device that will temporarily be mounted in stage-1.
369369- Must contain the current salt to create the challenge for this LUKS device.
370370- '';
371371- };
360360+ Options related to the storing the salt.
361361+ */
362362+ storage = {
363363+ device = mkOption {
364364+ default = "/dev/sda1";
365365+ type = types.path;
366366+ description = ''
367367+ An unencrypted device that will temporarily be mounted in stage-1.
368368+ Must contain the current salt to create the challenge for this LUKS device.
369369+ '';
370370+ };
372371373373- fsType = mkOption {
374374- default = "vfat";
375375- type = types.str;
376376- description = "The filesystem of the unencrypted device.";
377377- };
372372+ fsType = mkOption {
373373+ default = "vfat";
374374+ type = types.str;
375375+ description = "The filesystem of the unencrypted device.";
376376+ };
378377379379- mountPoint = mkOption {
380380- default = "/crypt-storage";
381381- type = types.str;
382382- description = "Path where the unencrypted device will be mounted during early boot.";
383383- };
378378+ mountPoint = mkOption {
379379+ default = "/crypt-storage";
380380+ type = types.str;
381381+ description = "Path where the unencrypted device will be mounted during early boot.";
382382+ };
384383385385- path = mkOption {
386386- default = "/crypt-storage/default";
387387- type = types.str;
388388- description = ''
389389- Absolute path of the salt on the unencrypted device with
390390- that device's root directory as "/".
391391- '';
384384+ path = mkOption {
385385+ default = "/crypt-storage/default";
386386+ type = types.str;
387387+ description = ''
388388+ Absolute path of the salt on the unencrypted device with
389389+ that device's root directory as "/".
390390+ '';
391391+ };
392392+ };
392393 };
393393- };
394394+ });
394395 };
395395- };
396396397397- }; };
397397+ }; }));
398398 };
399399400400 boot.initrd.luks.yubikeySupport = mkOption {
+8-13
nixos/modules/system/boot/networkd.nix
···471471472472 addresses = mkOption {
473473 default = [ ];
474474- type = types.listOf types.optionSet;
475475- options = [ addressOptions ];
474474+ type = with types; listOf (submodule [ addressOptions ]);
476475 description = ''
477476 A list of address sections to be added to the unit. See
478477 <citerefentry><refentrytitle>systemd.network</refentrytitle>
···482481483482 routes = mkOption {
484483 default = [ ];
485485- type = types.listOf types.optionSet;
486486- options = [ routeOptions ];
484484+ type = with types; listOf (submodule [ routeOptions ]);
487485 description = ''
488486 A list of route sections to be added to the unit. See
489487 <citerefentry><refentrytitle>systemd.network</refentrytitle>
···624622625623 systemd.network.links = mkOption {
626624 default = {};
627627- type = types.attrsOf types.optionSet;
628628- options = [ linkOptions ];
625625+ type = with types; attrsOf (submodule [ linkOptions ]);
629626 description = "Definition of systemd network links.";
630627 };
631628632629 systemd.network.netdevs = mkOption {
633630 default = {};
634634- type = types.attrsOf types.optionSet;
635635- options = [ netdevOptions ];
631631+ type = with types; attrsOf (submodule [ netdevOptions ]);
636632 description = "Definition of systemd network devices.";
637633 };
638634639635 systemd.network.networks = mkOption {
640636 default = {};
641641- type = types.attrsOf types.optionSet;
642642- options = [ networkOptions networkConfig ];
637637+ type = with types; attrsOf (submodule [ networkOptions networkConfig ]);
643638 description = "Definition of systemd networks.";
644639 };
645640646641 systemd.network.units = mkOption {
647642 description = "Definition of networkd units.";
648643 default = {};
649649- type = types.attrsOf types.optionSet;
650650- options = { name, config, ... }:
644644+ type = with types; attrsOf (submodule (
645645+ { name, config, ... }:
651646 { options = concreteUnitOptions;
652647 config = {
653648 unit = mkDefault (makeUnit name config);
654649 };
655655- };
650650+ }));
656651 };
657652658653 };
+16-26
nixos/modules/system/boot/systemd.nix
···389389 systemd.units = mkOption {
390390 description = "Definition of systemd units.";
391391 default = {};
392392- type = types.attrsOf types.optionSet;
393393- options = { name, config, ... }:
392392+ type = with types; attrsOf (submodule (
393393+ { name, config, ... }:
394394 { options = concreteUnitOptions;
395395 config = {
396396 unit = mkDefault (makeUnit name config);
397397 };
398398- };
398398+ }));
399399 };
400400401401 systemd.packages = mkOption {
···406406407407 systemd.targets = mkOption {
408408 default = {};
409409- type = types.attrsOf types.optionSet;
410410- options = [ targetOptions unitConfig ];
409409+ type = with types; attrsOf (submodule [ { options = targetOptions; } unitConfig] );
411410 description = "Definition of systemd target units.";
412411 };
413412414413 systemd.services = mkOption {
415414 default = {};
416416- type = types.attrsOf types.optionSet;
417417- options = [ serviceOptions unitConfig serviceConfig ];
415415+ type = with types; attrsOf (submodule [ { options = serviceOptions; } unitConfig serviceConfig ]);
418416 description = "Definition of systemd service units.";
419417 };
420418421419 systemd.sockets = mkOption {
422420 default = {};
423423- type = types.attrsOf types.optionSet;
424424- options = [ socketOptions unitConfig ];
421421+ type = with types; attrsOf (submodule [ { options = socketOptions; } unitConfig ]);
425422 description = "Definition of systemd socket units.";
426423 };
427424428425 systemd.timers = mkOption {
429426 default = {};
430430- type = types.attrsOf types.optionSet;
431431- options = [ timerOptions unitConfig ];
427427+ type = with types; attrsOf (submodule [ { options = timerOptions; } unitConfig ]);
432428 description = "Definition of systemd timer units.";
433429 };
434430435431 systemd.paths = mkOption {
436432 default = {};
437437- type = types.attrsOf types.optionSet;
438438- options = [ pathOptions unitConfig ];
433433+ type = with types; attrsOf (submodule [ { options = pathOptions; } unitConfig ]);
439434 description = "Definition of systemd path units.";
440435 };
441436442437 systemd.mounts = mkOption {
443438 default = [];
444444- type = types.listOf types.optionSet;
445445- options = [ mountOptions unitConfig mountConfig ];
439439+ type = with types; listOf (submodule [ { options = mountOptions; } unitConfig mountConfig ]);
446440 description = ''
447441 Definition of systemd mount units.
448442 This is a list instead of an attrSet, because systemd mandates the names to be derived from
···452446453447 systemd.automounts = mkOption {
454448 default = [];
455455- type = types.listOf types.optionSet;
456456- options = [ automountOptions unitConfig automountConfig ];
449449+ type = with types; listOf (submodule [ { options = automountOptions; } unitConfig automountConfig ]);
457450 description = ''
458451 Definition of systemd automount units.
459452 This is a list instead of an attrSet, because systemd mandates the names to be derived from
···600593 systemd.user.units = mkOption {
601594 description = "Definition of systemd per-user units.";
602595 default = {};
603603- type = types.attrsOf types.optionSet;
604604- options = { name, config, ... }:
596596+ type = with types; attrsOf (submodule (
597597+ { name, config, ... }:
605598 { options = concreteUnitOptions;
606599 config = {
607600 unit = mkDefault (makeUnit name config);
608601 };
609609- };
602602+ }));
610603 };
611604612605 systemd.user.services = mkOption {
613606 default = {};
614614- type = types.attrsOf types.optionSet;
615615- options = [ serviceOptions unitConfig serviceConfig ];
607607+ type = with types; attrsOf (submodule [ { options = serviceOptions; } unitConfig serviceConfig ] );
616608 description = "Definition of systemd per-user service units.";
617609 };
618610619611 systemd.user.timers = mkOption {
620612 default = {};
621621- type = types.attrsOf types.optionSet;
622622- options = [ timerOptions unitConfig ];
613613+ type = with types; attrsOf (submodule [ { options = timerOptions; } unitConfig ] );
623614 description = "Definition of systemd per-user timer units.";
624615 };
625616626617 systemd.user.sockets = mkOption {
627618 default = {};
628628- type = types.attrsOf types.optionSet;
629629- options = [ socketOptions unitConfig ];
619619+ type = with types; attrsOf (submodule [ { options = socketOptions; } unitConfig ] );
630620 description = "Definition of systemd per-user socket units.";
631621 };
632622
+3-3
nixos/modules/system/etc/etc.nix
···3333 options = {
34343535 environment.etc = mkOption {
3636- type = types.loaOf types.optionSet;
3736 default = {};
3837 example = literalExample ''
3938 { example-configuration-file =
···4746 Set of files that have to be linked in <filename>/etc</filename>.
4847 '';
49485050- options = singleton ({ name, config, ... }:
4949+ type = with types; loaOf (submodule (
5050+ { name, config, ... }:
5151 { options = {
52525353 enable = mkOption {
···117117 in mkDefault (pkgs.writeText name' config.text));
118118 };
119119120120- });
120120+ }));
121121122122 };
123123
+252-238
nixos/modules/tasks/network-interfaces.nix
···97979898 addrOpts = v:
9999 assert v == 4 || v == 6;
100100- {
101101- address = mkOption {
102102- type = types.str;
103103- description = ''
104104- IPv${toString v} address of the interface. Leave empty to configure the
105105- interface using DHCP.
106106- '';
107107- };
100100+ { options = {
101101+ address = mkOption {
102102+ type = types.str;
103103+ description = ''
104104+ IPv${toString v} address of the interface. Leave empty to configure the
105105+ interface using DHCP.
106106+ '';
107107+ };
108108109109- prefixLength = mkOption {
110110- type = types.addCheck types.int (n: n >= 0 && n <= (if v == 4 then 32 else 128));
111111- description = ''
112112- Subnet mask of the interface, specified as the number of
113113- bits in the prefix (<literal>${if v == 4 then "24" else "64"}</literal>).
114114- '';
109109+ prefixLength = mkOption {
110110+ type = types.addCheck types.int (n: n >= 0 && n <= (if v == 4 then 32 else 128));
111111+ description = ''
112112+ Subnet mask of the interface, specified as the number of
113113+ bits in the prefix (<literal>${if v == 4 then "24" else "64"}</literal>).
114114+ '';
115115+ };
115116 };
116117 };
117118···141142 { address = "10.0.0.1"; prefixLength = 16; }
142143 { address = "192.168.1.1"; prefixLength = 24; }
143144 ];
144144- type = types.listOf types.optionSet;
145145- options = addrOpts 4;
145145+ type = with types; listOf (submodule (addrOpts 4));
146146 description = ''
147147 List of IPv4 addresses that will be statically assigned to the interface.
148148 '';
···154154 { address = "fdfd:b3f0:482::1"; prefixLength = 48; }
155155 { address = "2001:1470:fffd:2098::e006"; prefixLength = 64; }
156156 ];
157157- type = types.listOf types.optionSet;
158158- options = addrOpts 6;
157157+ type = with types; listOf (submodule (addrOpts 6));
159158 description = ''
160159 List of IPv6 addresses that will be statically assigned to the interface.
161160 '';
···415414 <option>networking.useDHCP</option> is true, then every
416415 interface not listed here will be configured using DHCP.
417416 '';
418418- type = types.loaOf types.optionSet;
419419- options = [ interfaceOpts ];
417417+ type = with types; loaOf (submodule interfaceOpts);
420418 };
421419422420 networking.vswitches = mkOption {
···434432 interface.
435433 '';
436434437437- type = types.attrsOf types.optionSet;
435435+ type = with types; attrsOf (submodule {
438436439439- options = {
437437+ options = {
438438+439439+ interfaces = mkOption {
440440+ example = [ "eth0" "eth1" ];
441441+ type = types.listOf types.str;
442442+ description =
443443+ "The physical network interfaces connected by the vSwitch.";
444444+ };
440445441441- interfaces = mkOption {
442442- example = [ "eth0" "eth1" ];
443443- type = types.listOf types.str;
444444- description =
445445- "The physical network interfaces connected by the vSwitch.";
446446- };
446446+ controllers = mkOption {
447447+ type = types.listOf types.str;
448448+ default = [];
449449+ example = [ "ptcp:6653:[::1]" ];
450450+ description = ''
451451+ Specify the controller targets. For the allowed options see <literal>man 8 ovs-vsctl</literal>.
452452+ '';
453453+ };
447454448448- controllers = mkOption {
449449- type = types.listOf types.str;
450450- default = [];
451451- example = [ "ptcp:6653:[::1]" ];
452452- description = ''
453453- Specify the controller targets. For the allowed options see <literal>man 8 ovs-vsctl</literal>.
454454- '';
455455- };
455455+ openFlowRules = mkOption {
456456+ type = types.lines;
457457+ default = "";
458458+ example = ''
459459+ actions=normal
460460+ '';
461461+ description = ''
462462+ OpenFlow rules to insert into the Open vSwitch. All <literal>openFlowRules</literal> are
463463+ loaded with <literal>ovs-ofctl</literal> within one atomic operation.
464464+ '';
465465+ };
456466457457- openFlowRules = mkOption {
458458- type = types.lines;
459459- default = "";
460460- example = ''
461461- actions=normal
462462- '';
463463- description = ''
464464- OpenFlow rules to insert into the Open vSwitch. All <literal>openFlowRules</literal> are
465465- loaded with <literal>ovs-ofctl</literal> within one atomic operation.
466466- '';
467467- };
467467+ extraOvsctlCmds = mkOption {
468468+ type = types.lines;
469469+ default = "";
470470+ example = ''
471471+ set-fail-mode <switch_name> secure
472472+ set Bridge <switch_name> stp_enable=true
473473+ '';
474474+ description = ''
475475+ Commands to manipulate the Open vSwitch database. Every line executed with <literal>ovs-vsctl</literal>.
476476+ All commands are bundled together with the operations for adding the interfaces
477477+ into one atomic operation.
478478+ '';
479479+ };
468480469469- extraOvsctlCmds = mkOption {
470470- type = types.lines;
471471- default = "";
472472- example = ''
473473- set-fail-mode <switch_name> secure
474474- set Bridge <switch_name> stp_enable=true
475475- '';
476476- description = ''
477477- Commands to manipulate the Open vSwitch database. Every line executed with <literal>ovs-vsctl</literal>.
478478- All commands are bundled together with the operations for adding the interfaces
479479- into one atomic operation.
480480- '';
481481 };
482482483483- };
483483+ });
484484485485 };
486486···499499 bridge's network interface.
500500 '';
501501502502- type = types.attrsOf types.optionSet;
502502+ type = with types; attrsOf (submodule {
503503504504- options = {
504504+ options = {
505505506506- interfaces = mkOption {
507507- example = [ "eth0" "eth1" ];
508508- type = types.listOf types.str;
509509- description =
510510- "The physical network interfaces connected by the bridge.";
511511- };
506506+ interfaces = mkOption {
507507+ example = [ "eth0" "eth1" ];
508508+ type = types.listOf types.str;
509509+ description =
510510+ "The physical network interfaces connected by the bridge.";
511511+ };
512512513513- rstp = mkOption {
514514- example = true;
515515- default = false;
516516- type = types.bool;
517517- description = "Whether the bridge interface should enable rstp.";
513513+ rstp = mkOption {
514514+ example = true;
515515+ default = false;
516516+ type = types.bool;
517517+ description = "Whether the bridge interface should enable rstp.";
518518+ };
519519+518520 };
519521520520- };
522522+ });
521523522524 };
523525···538540 name specifying the name of the bond's network interface
539541 '';
540542541541- type = types.attrsOf types.optionSet;
543543+ type = with types; attrsOf (submodule {
544544+545545+ options = {
542546543543- options = {
547547+ interfaces = mkOption {
548548+ example = [ "enp4s0f0" "enp4s0f1" "wlan0" ];
549549+ type = types.listOf types.str;
550550+ description = "The interfaces to bond together";
551551+ };
544552545545- interfaces = mkOption {
546546- example = [ "enp4s0f0" "enp4s0f1" "wlan0" ];
547547- type = types.listOf types.str;
548548- description = "The interfaces to bond together";
549549- };
553553+ lacp_rate = mkOption {
554554+ default = null;
555555+ example = "fast";
556556+ type = types.nullOr types.str;
557557+ description = ''
558558+ Option specifying the rate in which we'll ask our link partner
559559+ to transmit LACPDU packets in 802.3ad mode.
560560+ '';
561561+ };
550562551551- lacp_rate = mkOption {
552552- default = null;
553553- example = "fast";
554554- type = types.nullOr types.str;
555555- description = ''
556556- Option specifying the rate in which we'll ask our link partner
557557- to transmit LACPDU packets in 802.3ad mode.
558558- '';
559559- };
563563+ miimon = mkOption {
564564+ default = null;
565565+ example = 100;
566566+ type = types.nullOr types.int;
567567+ description = ''
568568+ Miimon is the number of millisecond in between each round of polling
569569+ by the device driver for failed links. By default polling is not
570570+ enabled and the driver is trusted to properly detect and handle
571571+ failure scenarios.
572572+ '';
573573+ };
560574561561- miimon = mkOption {
562562- default = null;
563563- example = 100;
564564- type = types.nullOr types.int;
565565- description = ''
566566- Miimon is the number of millisecond in between each round of polling
567567- by the device driver for failed links. By default polling is not
568568- enabled and the driver is trusted to properly detect and handle
569569- failure scenarios.
570570- '';
571571- };
575575+ mode = mkOption {
576576+ default = null;
577577+ example = "active-backup";
578578+ type = types.nullOr types.str;
579579+ description = ''
580580+ The mode which the bond will be running. The default mode for
581581+ the bonding driver is balance-rr, optimizing for throughput.
582582+ More information about valid modes can be found at
583583+ https://www.kernel.org/doc/Documentation/networking/bonding.txt
584584+ '';
585585+ };
572586573573- mode = mkOption {
574574- default = null;
575575- example = "active-backup";
576576- type = types.nullOr types.str;
577577- description = ''
578578- The mode which the bond will be running. The default mode for
579579- the bonding driver is balance-rr, optimizing for throughput.
580580- More information about valid modes can be found at
581581- https://www.kernel.org/doc/Documentation/networking/bonding.txt
582582- '';
583583- };
587587+ xmit_hash_policy = mkOption {
588588+ default = null;
589589+ example = "layer2+3";
590590+ type = types.nullOr types.str;
591591+ description = ''
592592+ Selects the transmit hash policy to use for slave selection in
593593+ balance-xor, 802.3ad, and tlb modes.
594594+ '';
595595+ };
584596585585- xmit_hash_policy = mkOption {
586586- default = null;
587587- example = "layer2+3";
588588- type = types.nullOr types.str;
589589- description = ''
590590- Selects the transmit hash policy to use for slave selection in
591591- balance-xor, 802.3ad, and tlb modes.
592592- '';
593597 };
594598595595- };
599599+ });
596600 };
597601598602 networking.macvlans = mkOption {
599599- type = types.attrsOf types.optionSet;
600603 default = { };
601604 example = literalExample {
602605 wan = {
···608611 This option allows you to define macvlan interfaces which should
609612 be automatically created.
610613 '';
611611- options = {
614614+ type = with types; attrsOf (submodule {
615615+ options = {
612616613613- interface = mkOption {
614614- example = "enp4s0";
615615- type = types.str;
616616- description = "The interface the macvlan will transmit packets through.";
617617- };
617617+ interface = mkOption {
618618+ example = "enp4s0";
619619+ type = types.str;
620620+ description = "The interface the macvlan will transmit packets through.";
621621+ };
622622+623623+ mode = mkOption {
624624+ default = null;
625625+ type = types.nullOr types.str;
626626+ example = "vepa";
627627+ description = "The mode of the macvlan device.";
628628+ };
618629619619- mode = mkOption {
620620- default = null;
621621- type = types.nullOr types.str;
622622- example = "vepa";
623623- description = "The mode of the macvlan device.";
624630 };
625631626626- };
632632+ });
627633 };
628634629635 networking.sits = mkOption {
630630- type = types.attrsOf types.optionSet;
631636 default = { };
632637 example = literalExample {
633638 hurricane = {
···644649 description = ''
645650 This option allows you to define 6-to-4 interfaces which should be automatically created.
646651 '';
647647- options = {
652652+ type = with types; attrsOf (submodule {
653653+ options = {
648654649649- remote = mkOption {
650650- type = types.nullOr types.str;
651651- default = null;
652652- example = "10.0.0.1";
653653- description = ''
654654- The address of the remote endpoint to forward traffic over.
655655- '';
656656- };
655655+ remote = mkOption {
656656+ type = types.nullOr types.str;
657657+ default = null;
658658+ example = "10.0.0.1";
659659+ description = ''
660660+ The address of the remote endpoint to forward traffic over.
661661+ '';
662662+ };
663663+664664+ local = mkOption {
665665+ type = types.nullOr types.str;
666666+ default = null;
667667+ example = "10.0.0.22";
668668+ description = ''
669669+ The address of the local endpoint which the remote
670670+ side should send packets to.
671671+ '';
672672+ };
657673658658- local = mkOption {
659659- type = types.nullOr types.str;
660660- default = null;
661661- example = "10.0.0.22";
662662- description = ''
663663- The address of the local endpoint which the remote
664664- side should send packets to.
665665- '';
666666- };
674674+ ttl = mkOption {
675675+ type = types.nullOr types.int;
676676+ default = null;
677677+ example = 255;
678678+ description = ''
679679+ The time-to-live of the connection to the remote tunnel endpoint.
680680+ '';
681681+ };
667682668668- ttl = mkOption {
669669- type = types.nullOr types.int;
670670- default = null;
671671- example = 255;
672672- description = ''
673673- The time-to-live of the connection to the remote tunnel endpoint.
674674- '';
675675- };
683683+ dev = mkOption {
684684+ type = types.nullOr types.str;
685685+ default = null;
686686+ example = "enp4s0f0";
687687+ description = ''
688688+ The underlying network device on which the tunnel resides.
689689+ '';
690690+ };
676691677677- dev = mkOption {
678678- type = types.nullOr types.str;
679679- default = null;
680680- example = "enp4s0f0";
681681- description = ''
682682- The underlying network device on which the tunnel resides.
683683- '';
684692 };
685693686686- };
694694+ });
687695 };
688696689697 networking.vlans = mkOption {
···706714 specifying the name of the vlan interface.
707715 '';
708716709709- type = types.attrsOf types.optionSet;
717717+ type = with types; attrsOf (submodule {
710718711711- options = {
719719+ options = {
712720713713- id = mkOption {
714714- example = 1;
715715- type = types.int;
716716- description = "The vlan identifier";
721721+ id = mkOption {
722722+ example = 1;
723723+ type = types.int;
724724+ description = "The vlan identifier";
725725+ };
726726+727727+ interface = mkOption {
728728+ example = "enp4s0";
729729+ type = types.str;
730730+ description = "The interface the vlan will transmit packets through.";
731731+ };
732732+717733 };
718734719719- interface = mkOption {
720720- example = "enp4s0";
721721- type = types.str;
722722- description = "The interface the vlan will transmit packets through.";
723723- };
735735+ });
724736725725- };
726737 };
727738728739 networking.wlanInterfaces = mkOption {
···760771 would have to be created explicitly.
761772 '';
762773763763- type = types.attrsOf types.optionSet;
774774+ type = with types; attrsOf (submodule {
764775765765- options = {
776776+ options = {
766777767767- device = mkOption {
768768- type = types.string;
769769- example = "wlp6s0";
770770- description = "The name of the underlying hardware WLAN device as assigned by <literal>udev</literal>.";
771771- };
778778+ device = mkOption {
779779+ type = types.string;
780780+ example = "wlp6s0";
781781+ description = "The name of the underlying hardware WLAN device as assigned by <literal>udev</literal>.";
782782+ };
772783773773- type = mkOption {
774774- type = types.string;
775775- default = "managed";
776776- example = "ibss";
777777- description = ''
778778- The type of the WLAN interface. The type has to be either <literal>managed</literal>,
779779- <literal>ibss</literal>, <literal>monitor</literal>, <literal>mesh</literal> or <literal>wds</literal>.
780780- Also, the type has to be supported by the underlying hardware of the device.
781781- '';
782782- };
784784+ type = mkOption {
785785+ type = types.string;
786786+ default = "managed";
787787+ example = "ibss";
788788+ description = ''
789789+ The type of the WLAN interface. The type has to be either <literal>managed</literal>,
790790+ <literal>ibss</literal>, <literal>monitor</literal>, <literal>mesh</literal> or <literal>wds</literal>.
791791+ Also, the type has to be supported by the underlying hardware of the device.
792792+ '';
793793+ };
783794784784- meshID = mkOption {
785785- type = types.nullOr types.string;
786786- default = null;
787787- description = "MeshID of interface with type <literal>mesh</literal>.";
788788- };
795795+ meshID = mkOption {
796796+ type = types.nullOr types.string;
797797+ default = null;
798798+ description = "MeshID of interface with type <literal>mesh</literal>.";
799799+ };
789800790790- flags = mkOption {
791791- type = types.nullOr types.string;
792792- default = null;
793793- example = "control";
794794- description = ''
795795- Flags for interface of type <literal>monitor</literal>. The valid flags are:
796796- none: no special flags
797797- fcsfail: show frames with FCS errors
798798- control: show control frames
799799- otherbss: show frames from other BSSes
800800- cook: use cooked mode
801801- active: use active mode (ACK incoming unicast packets)
802802- '';
803803- };
801801+ flags = mkOption {
802802+ type = types.nullOr types.string;
803803+ default = null;
804804+ example = "control";
805805+ description = ''
806806+ Flags for interface of type <literal>monitor</literal>. The valid flags are:
807807+ none: no special flags
808808+ fcsfail: show frames with FCS errors
809809+ control: show control frames
810810+ otherbss: show frames from other BSSes
811811+ cook: use cooked mode
812812+ active: use active mode (ACK incoming unicast packets)
813813+ '';
814814+ };
815815+816816+ fourAddr = mkOption {
817817+ type = types.nullOr types.bool;
818818+ default = null;
819819+ description = "Whether to enable <literal>4-address mode</literal> with type <literal>managed</literal>.";
820820+ };
804821805805- fourAddr = mkOption {
806806- type = types.nullOr types.bool;
807807- default = null;
808808- description = "Whether to enable <literal>4-address mode</literal> with type <literal>managed</literal>.";
809809- };
822822+ mac = mkOption {
823823+ type = types.nullOr types.str;
824824+ default = null;
825825+ example = "02:00:00:00:00:01";
826826+ description = ''
827827+ MAC address to use for the device. If <literal>null</literal>, then the MAC of the
828828+ underlying hardware WLAN device is used.
810829811811- mac = mkOption {
812812- type = types.nullOr types.str;
813813- default = null;
814814- example = "02:00:00:00:00:01";
815815- description = ''
816816- MAC address to use for the device. If <literal>null</literal>, then the MAC of the
817817- underlying hardware WLAN device is used.
830830+ INFO: Locally administered MAC addresses are of the form:
831831+ <itemizedlist>
832832+ <listitem><para>x2:xx:xx:xx:xx:xx</para></listitem>
833833+ <listitem><para>x6:xx:xx:xx:xx:xx</para></listitem>
834834+ <listitem><para>xA:xx:xx:xx:xx:xx</para></listitem>
835835+ <listitem><para>xE:xx:xx:xx:xx:xx</para></listitem>
836836+ </itemizedlist>
837837+ '';
838838+ };
818839819819- INFO: Locally administered MAC addresses are of the form:
820820- <itemizedlist>
821821- <listitem><para>x2:xx:xx:xx:xx:xx</para></listitem>
822822- <listitem><para>x6:xx:xx:xx:xx:xx</para></listitem>
823823- <listitem><para>xA:xx:xx:xx:xx:xx</para></listitem>
824824- <listitem><para>xE:xx:xx:xx:xx:xx</para></listitem>
825825- </itemizedlist>
826826- '';
827840 };
828841829829- };
842842+ });
843843+830844 };
831845832846 networking.useDHCP = mkOption {
+2-4
nixos/modules/virtualisation/containers.nix
···473473 };
474474475475 extraVeths = mkOption {
476476- type = types.attrsOf types.optionSet;
476476+ type = with types; attrsOf (submodule networkOptions);
477477 default = {};
478478- options = networkOptions;
479478 description = ''
480479 Extra veth-pairs to be created for the container
481480 '';
···490489 };
491490492491 bindMounts = mkOption {
493493- type = types.loaOf types.optionSet;
494494- options = [ bindMountOpts ];
492492+ type = with types; loaOf (submodule bindMountOpts);
495493 default = {};
496494 example = { "/home" = { hostPath = "/home/alice";
497495 isReadOnly = false; };