-
Notifications
You must be signed in to change notification settings - Fork 25
/
options.nix
1332 lines (1248 loc) · 40 KB
/
options.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{ config, lib, ... }:
with lib;
let
commonVolumeOptions = {
options = {
file = mkOption {
type = types.str;
description = "The volume file.";
example = "/path/to/volume.img";
};
aio = mkOption {
type = types.nullOr types.str;
description = "Asynchronous I/O mode.";
example = "native";
default = null;
};
backup = mkOption {
type = types.nullOr types.bool;
description = "Whether to backup.";
example = true;
default = null;
};
bps = mkOption {
type = types.nullOr types.str;
description = "Bytes per second rate.";
example = "10M";
default = null;
};
bps_max_length = mkOption {
type = types.nullOr types.int;
description = "Maximum length in seconds for BPS.";
example = 60;
default = null;
};
bps_rd = mkOption {
type = types.nullOr types.str;
description = "Read BPS rate.";
example = "5M";
default = null;
};
bps_rd_max_length = mkOption {
type = types.nullOr types.int;
description = "Maximum length in seconds for read BPS.";
example = 30;
default = null;
};
bps_wr = mkOption {
type = types.nullOr types.str;
description = "Write BPS rate.";
example = "5M";
default = null;
};
bps_wr_max_length = mkOption {
type = types.nullOr types.int;
description = "Maximum length in seconds for write BPS.";
example = 30;
default = null;
};
cache = mkOption {
type = types.nullOr types.str;
description = "Cache mode.";
example = "none";
default = null;
};
cyls = mkOption {
type = types.nullOr types.int;
description = "Number of cylinders.";
example = 1024;
default = null;
};
detect_zeroes = mkOption {
type = types.nullOr types.bool;
description = "Whether to detect zeroes.";
example = false;
default = null;
};
discard = mkOption {
type = types.nullOr types.str;
description = "Discard mode.";
example = "ignore";
default = null;
};
format = mkOption {
type = types.nullOr types.str;
description = "Disk format.";
default = null;
example = "qcow2";
};
heads = mkOption {
type = types.nullOr types.int;
description = "Number of disk heads.";
example = 16;
default = null;
};
import-from = mkOption {
type = types.nullOr types.str;
description = "Source volume to import from.";
example = "/path/to/source-volume.img";
default = null;
};
iops = mkOption {
type = types.nullOr types.str;
description = "IO operations per second rate.";
example = "1000";
default = null;
};
iops_max = mkOption {
type = types.nullOr types.str;
description = "Maximum IOPS rate.";
example = "2000";
default = null;
};
iops_max_length = mkOption {
type = types.nullOr types.int;
description = "Maximum length in seconds for IOPS.";
example = 60;
default = null;
};
iops_rd = mkOption {
type = types.nullOr types.str;
description = "Read IOPS rate.";
example = "500";
default = null;
};
iops_rd_max = mkOption {
type = types.nullOr types.str;
description = "Maximum read IOPS rate.";
example = "1000";
default = null;
};
iops_rd_max_length = mkOption {
type = types.nullOr types.int;
description = "Maximum length in seconds for read IOPS.";
example = 30;
default = null;
};
iops_wr = mkOption {
type = types.nullOr types.str;
description = "Write IOPS rate.";
example = "500";
default = null;
};
iops_wr_max = mkOption {
type = types.nullOr types.str;
description = "Maximum write IOPS rate.";
example = "1000";
default = null;
};
iops_wr_max_length = mkOption {
type = types.nullOr types.int;
description = "Maximum length in seconds for write IOPS.";
example = 30;
default = null;
};
mbps = mkOption {
type = types.nullOr types.str;
description = "Megabytes per second rate.";
example = "10M";
default = null;
};
mbps_max = mkOption {
type = types.nullOr types.str;
description = "Maximum MBPS rate.";
example = "20M";
default = null;
};
mbps_rd = mkOption {
type = types.nullOr types.str;
description = "Read MBPS rate.";
example = "5M";
default = null;
};
mbps_rd_max = mkOption {
type = types.nullOr types.str;
description = "Maximum read MBPS rate.";
example = "10M";
default = null;
};
mbps_wr = mkOption {
type = types.nullOr types.str;
description = "Write MBPS rate.";
example = "5M";
default = null;
};
mbps_wr_max = mkOption {
type = types.nullOr types.str;
description = "Maximum write MBPS rate.";
example = "10M";
default = null;
};
media = mkOption {
type = types.nullOr types.str;
description = "Media type.";
example = "disk";
default = null;
};
model = mkOption {
type = types.nullOr types.str;
description = "Model name.";
example = "virtio";
default = null;
};
replicate = mkOption {
type = types.nullOr types.bool;
description = "Whether to replicate.";
example = false;
default = null;
};
rerror = mkOption {
type = types.nullOr types.str;
description = "Read error handling.";
example = "report";
default = null;
};
secs = mkOption {
type = types.nullOr types.int;
description = "Number of seconds.";
example = 120;
default = null;
};
serial = mkOption {
type = types.nullOr types.str;
description = "Serial number.";
example = "123456789";
default = null;
};
shared = mkOption {
type = types.nullOr types.bool;
description = "Whether the volume is shared.";
example = false;
default = null;
};
size = mkOption {
type = types.nullOr types.str;
description = "Disk size.";
example = "10G";
default = null;
};
snapshot = mkOption {
type = types.nullOr types.bool;
description = "Whether to enable snapshots.";
example = true;
default = null;
};
ssd = mkOption {
type = types.nullOr types.bool;
description = "Whether the disk is SSD.";
example = true;
default = null;
};
trans = mkOption {
type = types.nullOr types.str;
description = "Translation mode.";
example = "auto";
default = null;
};
werror = mkOption {
type = types.nullOr types.str;
description = "Write error handling.";
example = "stop";
default = null;
};
wwn = mkOption {
type = types.nullOr types.str;
description = "World Wide Name (WWN).";
example = "12345678-1234-1234-1234-1234567890ab";
default = null;
};
};
};
in
{
meta.maintainers = with maintainers; [
julienmalka
camillemndn
];
options = {
vmid = mkOption {
type = types.nullOr (types.ints.between 100 999999999);
default = null;
description = "The (unique) ID of the VM.";
};
acpi = mkOption {
type = types.nullOr types.bool;
default = true;
description = "Enable/disable ACPI.";
};
affinity = mkOption {
type = types.nullOr types.str;
default = null;
description = "List of host cores used to execute guest processes.";
example = "0,5,8-11";
};
agent = mkOption {
type = types.nullOr (
types.submodule {
options = {
enabled = mkEnableOption "Enable or disable communication with the QEMU Guest Agent.";
freeze_fs_on_backup = mkEnableOption "Freeze file systems on backup.";
fstrim_cloned_disks = mkEnableOption "Enable or disable fstrim on cloned disks.";
type = mkOption {
type = types.enum [
"virtio"
"isa"
];
default = "virtio";
description = "Specify the type of QEMU Guest Agent device.";
};
};
}
);
default = null;
description = "Enable/disable communication with the QEMU Guest Agent and its properties.";
};
arch = mkOption {
type = types.nullOr (
types.enum [
"x86_64"
"aarch64"
]
);
default = null;
description = "Virtual processor architecture. Defaults to the host.";
};
archive = mkOption {
type = types.nullOr types.str;
default = null;
description = "The backup archive. Either the file system path to a .tar or .vma file or a proxmox storage backup volume identifier.";
};
args = mkOption {
type = types.nullOr types.str;
default = null;
description = "Arbitrary arguments passed to kvm. This option is for experts only.";
example = "-no-reboot -smbios 'type=0,vendor=FOO'";
};
audio0 = mkOption {
type = types.nullOr (
types.submodule {
options = {
device = mkOption {
type = types.enum [
"ich9-intel-hda"
"intel-hda"
"AC97"
];
default = "ich9-intel-hda";
description = "Specify the type of audio device to be used.";
};
driver = mkOption {
type = types.enum [
"spice"
"none"
];
default = "none";
description = "Specify the audio driver to be used.";
};
};
}
);
default = null;
description = "Configure an audio device, useful in combination with QXL/Spice.";
};
autostart = mkEnableOption "Automatic restart after crash (currently ignored).";
balloon = mkOption {
type = types.nullOr types.int;
default = null;
description = "Amount of target RAM for the VM in MiB. Using zero disables the balloon driver.";
};
bios = mkOption {
type = types.enum [
"seabios"
"ovmf"
];
default = "seabios";
description = "Select BIOS implementation.";
};
boot = mkOption {
type = types.nullOr (
types.submodule {
options = {
order = mkOption {
type = types.listOf types.str;
default = [ ];
description = "Specify boot order of devices (e.g., 'disk', 'cdrom').";
};
};
}
);
default = null;
description = "Specify guest boot order.";
};
bwlimit = mkOption {
type = types.nullOr types.int;
default = null;
description = "Override I/O bandwidth limit (in KiB/s).";
};
cdrom = mkOption {
type = types.nullOr types.str;
default = null;
description = "Alias for option -ide2.";
};
cores = mkOption {
type = types.int;
default = 1;
description = "The number of cores per socket.";
};
cpu = mkOption {
type = types.nullOr (
types.submodule {
options = {
cputype = mkOption {
type = types.str;
example = "host";
description = "Specify the CPU type to emulate.";
};
flags = mkOption {
type = types.str;
example = "+vmx;-svm";
description = "CPU flags to enable or disable.";
};
hidden = mkEnableOption "Whether to hide the CPU from the guest.";
hv-vendor-id = mkOption {
type = types.str;
example = "MyHypervisor";
description = "Hypervisor vendor ID string.";
};
phys-bits = mkOption {
type = types.str;
default = "host";
example = "64";
description = "Number of physical address bits to use (between 8 and 64) or 'host' to use host settings.";
};
reported-model = mkOption {
type = types.str;
example = "IvyBridge";
description = "Reported CPU model string.";
};
};
}
);
default = null;
description = "Emulated CPU type.";
};
cpulimit = mkOption {
type = types.ints.between 0 128;
default = 0;
description = ''
Limit of CPU usage.
NOTE: If the computer has 2 CPUs, it has total of '2' CPU time. Value '0' indicates no CPU limit.
'';
};
cpuunits = mkOption {
type = types.ints.between 1 262144;
default = 1024;
description = "CPU weight for a VM. The larger the number, the more CPU time this VM gets.";
};
description = mkOption {
type = types.nullOr types.str;
default = null;
description = "Description for the VM. Shown in the web-interface VM's summary.";
};
efidisk0 = mkOption {
type = types.nullOr (
types.submodule {
options = {
file = mkOption {
type = types.str;
example = "STORAGE_ID:10";
description = ''
Specify the volume for the disk.
Use STORAGE_ID:SIZE_IN_GiB to allocate a new volume.
Note that SIZE_IN_GiB is ignored here and that the default EFI vars are copied to the volume instead.
Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume.
'';
};
efitype = mkOption {
type = types.nullOr (
types.enum [
"2m"
"4m"
]
);
default = "4m";
example = "2m";
description = "Specify the EFI vars disk size type.";
};
format = mkOption {
type = types.nullOr types.str;
example = "qcow2";
default = null;
description = "Specify the disk format.";
};
import-from = mkOption {
type = types.nullOr types.str;
example = "source-volume";
default = null;
description = "Specify the source volume to import from.";
};
pre-enrolled-keys = mkEnableOption "Whether to pre-enroll keys.";
size = mkOption {
type = types.nullOr types.str;
example = "10GiB";
default = null;
description = "Specify the size of the disk. This parameter is ignored if 'file' specifies an EFI vars disk.";
};
};
}
);
default = null;
description = "Configure a disk for storing EFI vars.";
};
force = mkOption {
type = types.nullOr types.bool;
default = null;
description = "Allow to overwrite existing VM.";
};
freeze = mkEnableOption "Freeze CPU at startup.";
hookscript = mkOption {
type = types.nullOr types.str;
default = null;
description = "Script that will be executed during various steps in the VM's lifetime.";
};
hostpci = mkOption {
type = types.nullOr (
types.listOf (
types.submodule {
options = {
host = mkOption {
type = types.listOf types.str;
example = [ "0000:00:1f.2" ];
description = "Specify the host PCI IDs to map into the guest.";
};
device-id = mkOption {
type = types.str;
example = "1234";
description = "Specify the device ID of the PCI device.";
};
legacy-igd = mkEnableOption "Enable or disable legacy integrated graphics device support.";
mapping = mkOption {
type = types.str;
description = "Specify the mapping ID for the PCI device.";
};
mdev = mkOption {
type = types.str;
description = "Specify the mediated device for PCI passthrough.";
};
pcie = mkEnableOption "Enable or disable PCIe support for the device.";
rombar = mkEnableOption "Enable or disable ROMBAR for the device.";
romfile = mkOption {
type = types.str;
example = "/path/to/romfile.rom";
description = "Specify the path to the ROM file for the device.";
};
sub-device-id = mkOption {
type = types.str;
example = "5678";
description = "Specify the sub-device ID of the PCI device.";
};
sub-vendor-id = mkOption {
type = types.str;
example = "abcd";
description = "Specify the sub-vendor ID of the PCI device.";
};
vendor-id = mkOption {
type = types.str;
example = "dead";
description = "Specify the vendor ID of the PCI device.";
};
x-vga = mkEnableOption "Enable or disable VGA support for the PCI device.";
};
}
)
);
default = null;
description = ''
Map host PCI devices into guest.
NOTE: This option allows direct access to host hardware. So it is no longer
possible to migrate such machines - use with special care.
CAUTION: Experimental! User reported problems with this option.
'';
};
hotplug = mkOption {
type = types.either types.bool (
types.listOf (
types.enum [
"network"
"disk"
"cpu"
"memory"
"usb"
"cloudinit"
]
)
);
default = [
"network"
"disk"
"usb"
];
description = "Selectively enable hotplug features. Use 'false' to disable hotplug completely.";
};
hugepages = mkOption {
type = types.nullOr (
types.enum [
"any"
"2"
"1024"
]
);
default = null;
description = "Enable/disable hugepages memory.";
};
ide = mkOption {
type = types.listOf (types.submodule commonVolumeOptions);
default = [ ];
description = "Use volume as IDE hard disk or CD-ROM.";
};
ivshmem = mkOption {
type = types.nullOr (
types.submodule {
options = {
size = mkOption {
type = types.int;
description = "Size of the shared memory in megabytes.";
};
name = mkOption {
type = types.str;
description = "Name for the shared memory region.";
example = "vmshm1";
};
};
}
);
description = "Inter-VM shared memory. Useful for direct communication between VMs, or to the host.";
default = null;
};
keephugepages = mkEnableOption "Use together with hugepages. If enabled, hugepages will not not be deleted after VM shutdown and can be used for subsequent starts.";
keyboard = mkOption {
type = types.nullOr (
types.enum [
"de"
"de-ch"
"da"
"en-gb"
"en-us"
"es"
"fi"
"fr"
"fr-be"
"fr-ca"
"fr-ch"
"hu"
"is"
"it"
"ja"
"lt"
"mk"
"nl"
"no"
"pl"
"pt"
"pt-br"
"sv"
"sl"
"tr"
]
);
default = null;
description = "Keyboard layout for VNC server. This option is generally not required and is often better handled from within the guest OS.";
};
kvm = mkOption {
type = types.bool;
default = true;
description = "Enable/disable KVM hardware virtualization.";
};
live-restore = mkEnableOption "Start the VM immediately while importing or restoring in the background.";
localtime = mkEnableOption "Set the real time clock (RTC) to local time.";
lock = mkOption {
type = types.nullOr (
types.enum [
"backup"
"clone"
"create"
"migrate"
"rollback"
"snapshot"
"snapshot-delete"
"suspending"
"suspended"
]
);
default = null;
description = "Lock/unlock the VM.";
};
machine = mkOption {
type = types.nullOr (
types.submodule {
options = {
type = mkOption {
type = types.str;
description = "Specifies the QEMU machine type.";
example = "pc-i440fx-6.0";
};
viommu = mkOption {
type = types.enum [
"intel"
"virtio"
];
description = "Specifies the IOMMU type for the QEMU machine.";
example = "intel";
};
};
}
);
description = "Specify the QEMU machine.";
default = null;
};
memory = mkOption {
type = types.int;
description = "Specifies the current memory size in megabytes.";
example = 2048;
};
migrate_downtime = mkOption {
type = types.float;
default = 0.1;
description = "Set maximum tolerated downtime (in seconds) for migrations. Should the migration not be able to converge in the very end, because too much newly dirtied RAM needs to be transferred, the limit will be increased automatically step-by-step until migration can converge.";
};
migrate_speed = mkOption {
type = types.int;
default = 0;
description = "Set maximum speed (in MB/s) for migrations. Value 0 is no limit.";
};
net = mkOption {
type = types.listOf (
types.submodule {
options = {
model = mkOption {
type = types.enum [
"e1000"
"virtio"
"rtl8139"
"vmxnet3"
];
description = "Specifies the network device model.";
example = "virtio";
};
bridge = mkOption {
type = types.str;
description = "Specifies the bridge to which the network device will be connected.";
example = "vmbr0";
};
firewall = mkOption {
type = types.bool;
default = true;
description = "Enable or disable the firewall on this network device.";
};
link_down = mkEnableOption "Specifies whether the network link is down.";
macaddr = mkOption {
type = types.nullOr types.str;
default = null;
description = "Specifies the MAC address for the network device.";
example = "52:54:00:12:34:56";
};
mtu = mkOption {
type = types.nullOr types.int;
default = null;
description = "Specifies the MTU (Maximum Transmission Unit) for the network device.";
example = 1500;
};
queues = mkOption {
type = types.nullOr types.int;
default = null;
description = "Specifies the number of queues for the network device.";
example = 4;
};
rate = mkOption {
type = types.nullOr types.float;
default = null;
description = "Specifies the network rate limit in Mbps.";
example = 100.0;
};
tag = mkOption {
type = types.nullOr types.int;
default = null;
description = "Specifies the VLAN tag ID.";
example = 100;
};
trunks = mkOption {
type = types.listOf types.int;
default = [ ];
description = "Specifies a list of VLAN IDs for trunking.";
example = [
100
200
300
];
};
custom_macaddr = mkOption {
type = types.nullOr types.str;
default = null;
description = "Specifies a custom MAC address for the network device.";
example = "52:54:00:ab:cd:ef";
};
};
}
);
default = [ ];
description = "Specify network devices.";
};
numa = mkEnableOption "NUMA.";
numa_config = mkOption {
type = types.listOf (
types.submodule {
options = {
cpus = mkOption {
type = types.listOf types.str;
description = "Specifies the CPU IDs or ranges of IDs to be associated with the NUMA node.";
example = [
"0-3"
"5"
];
};
hostnodes = mkOption {
type = types.str;
description = "Specifies the host NUMA node IDs or ranges of IDs.";
example = "0-1";
};
memory = mkOption {
type = types.int;
description = "Specifies the amount of memory (in MiB) to be allocated to the NUMA node.";
example = 2048;
};
policy = mkOption {
type = types.enum [
"preferred"
"bind"
"interleave"
];
description = "Specifies the NUMA memory policy.";
example = "preferred";
};
};
}
);
default = [ ];
description = "NUMA topology.";
};
onboot = mkEnableOption "Specifies whether a VM will be started during system bootup.";
ostype = mkOption {
type = types.enum [
"other"
"l24"
"l26"
];
default = "l26";
description = "Specify guest operating system.";
};
parallel = mkOption {
type = types.listOf (types.strMatching "(/dev/parport[[:digit:]]+|/dev/usb/lp[[:digit:]]+)");
default = [ ];
example = [ "/dev/parport0" ];
description = "Map host parallel devices.";
};
pool = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
Map host parallel devices (up to 3).
NOTE: This option allows direct access to host hardware. So it is no longer possible to migrate such
machines - use with special care.
CAUTION: Experimental! User reported problems with this option.
'';
};
protection = mkEnableOption "Sets the protection flag of the VM. This will disable the remove VM and remove disk operations.";
reboot = mkOption {
type = types.bool;
default = true;
description = "Allow reboot. If set to 'false' the VM exit on reboot.";
};
rng0 = mkOption {
type = types.submodule {
options = {
source = mkOption {
type = types.nullOr (
types.enum [
"/dev/urandom"
"/dev/random"
"/dev/hwrng"
]
);
default = null;
description = "Specifies the source of entropy for the VirtIO-based RNG device.";
example = "/dev/urandom";
};
max_bytes = mkOption {
type = types.nullOr types.int;
default = null;
description = "Specifies the maximum number of bytes that can be consumed from the RNG source per period.";
example = 1024;
};
period = mkOption {
type = types.nullOr types.int;
default = null;
description = "Specifies the period in milliseconds during which max_bytes can be consumed.";
example = 1000;
};
};
};
default = { };
description = "Configure a VirtIO-based Random Number Generator.";
};
sata = mkOption {
type = types.listOf (types.submodule commonVolumeOptions);
default = [ ];
description = "Use volume as SATA hard disk or CD-ROM.";
};
scsi = mkOption {
type = types.listOf (
types.submodule {
options = commonVolumeOptions.options // {
iothread = mkOption {
type = types.bool;
default = true;
description = "Enable or disable I/O threads.";
};
product = mkOption {
type = types.nullOr types.str;
default = null;
description = "Product name for the SCSI disk.";
};
queues = mkOption {
type = types.nullOr types.int;
default = null;
description = "Number of SCSI queues.";
};
scsiblock = mkEnableOption "Enable or disable SCSI block mode.";
ro = mkEnableOption "Enable or disable read-only mode.";
vendor = mkOption {
type = types.nullOr types.str;
default = null;
description = "Vendor name for the SCSI disk.";