···145146`diskSize` (Number; _optional_)
147148-: Controls the disk size (in megabytes) of the VM used to run the script specified in `runAsRoot`.
149 This attribute is ignored if `runAsRoot` is `null`.
150151 _Default value:_ 1024.
152153`buildVMMemorySize` (Number; _optional_)
154155-: Controls the amount of memory (in megabytes) provisioned for the VM used to run the script specified in `runAsRoot`.
156 This attribute is ignored if `runAsRoot` is `null`.
157158 _Default value:_ 512.
···145146`diskSize` (Number; _optional_)
147148+: Controls the disk size in MiB (1024x1024 bytes) of the VM used to run the script specified in `runAsRoot`.
149 This attribute is ignored if `runAsRoot` is `null`.
150151 _Default value:_ 1024.
152153`buildVMMemorySize` (Number; _optional_)
154155+: Controls the amount of memory in MiB (1024x1024 bytes) provisioned for the VM used to run the script specified in `runAsRoot`.
156 This attribute is ignored if `runAsRoot` is `null`.
157158 _Default value:_ 512.
+1-1
doc/build-helpers/images/makediskimage.section.md
···108 diskSize = "auto";
109 additionalSpace = "0M"; # Defaults to 512M.
110 copyChannel = false;
111- memSize = 2048; # Qemu VM memory size in megabytes. Defaults to 1024M.
112}
113```
···108 diskSize = "auto";
109 additionalSpace = "0M"; # Defaults to 512M.
110 copyChannel = false;
111+ memSize = 2048; # Qemu VM memory size in MiB (1024*1024 bytes). Defaults to 1024M.
112}
113```
+1-1
doc/build-helpers/special/vm-tools.section.md
···23### Attributes {#vm-tools-runInLinuxVM-attributes}
2425* `preVM` (optional). Shell command to be evaluated *before* the VM is started (i.e., on the host).
26-* `memSize` (optional, default `512`). The memory size of the VM in MiB.
27* `diskImage` (optional). A file system image to be attached to `/dev/sda`.
28 Note that currently we expect the image to contain a filesystem, not a full disk image with a partition table etc.
29
···23### Attributes {#vm-tools-runInLinuxVM-attributes}
2425* `preVM` (optional). Shell command to be evaluated *before* the VM is started (i.e., on the host).
26+* `memSize` (optional, default `512`). The memory size of the VM in MiB (1024×1024 bytes).
27* `diskImage` (optional). A file system image to be attached to `/dev/sda`.
28 Note that currently we expect the image to contain a filesystem, not a full disk image with a partition table etc.
29
···9293`virtualisation.memorySize`
9495-: The memory of the VM in megabytes.
9697`virtualisation.vlans`
98
···9293`virtualisation.memorySize`
9495+: The memory of the VM in MiB (1024×1024 bytes).
9697`virtualisation.vlans`
98
+2-2
nixos/lib/make-disk-image.nix
···104 # The NixOS configuration to be installed onto the disk image.
105 config,
106107- # The size of the disk, in megabytes.
108 # if "auto" size is calculated based on the contents copied to it and
109 # additionalSpace is taken into account.
110 diskSize ? "auto",
···160 # Shell code executed after the VM has finished.
161 postVM ? "",
162163- # Guest memory size
164 memSize ? 1024,
165166 # Copy the contents of the Nix store to the root of the image and
···104 # The NixOS configuration to be installed onto the disk image.
105 config,
106107+ # The size of the disk, in MiB (1024*1024 bytes).
108 # if "auto" size is calculated based on the contents copied to it and
109 # additionalSpace is taken into account.
110 diskSize ? "auto",
···160 # Shell code executed after the VM has finished.
161 postVM ? "",
162163+ # Guest memory size in MiB (1024*1024 bytes)
164 memSize ? 1024,
165166 # Copy the contents of the Nix store to the root of the image and
+3-3
nixos/lib/make-multi-disk-zfs-image.nix
···30 # The NixOS configuration to be installed onto the disk image.
31 config,
3233- # size of the FAT boot disk, in megabytes.
34 bootSize ? 1024,
3536- # The size of the root disk, in megabytes.
37 rootSize ? 2048,
3839 # The name of the ZFS pool
···74 # Shell code executed after the VM has finished.
75 postVM ? "",
7677- # Guest memory size
78 memSize ? 1024,
7980 name ? "nixos-disk-image",
···30 # The NixOS configuration to be installed onto the disk image.
31 config,
3233+ # size of the FAT boot disk in MiB (1024*1024 bytes)
34 bootSize ? 1024,
3536+ # The size of the root disk in MiB (1024*1024 bytes)
37 rootSize ? 2048,
3839 # The name of the ZFS pool
···74 # Shell code executed after the VM has finished.
75 postVM ? "",
7677+ # Guest memory size in MiB (1024*1024 bytes)
78 memSize ? 1024,
7980 name ? "nixos-disk-image",
+4-4
nixos/lib/make-single-disk-zfs-image.nix
···19 # The NixOS configuration to be installed onto the disk image.
20 config,
2122- # size of the FAT partition, in megabytes.
23- bootSize ? 1024
2425- , # memory allocated for virtualized build instance
26 memSize ? 1024,
2728- # The size of the root partition, in megabytes.
29 rootSize ? 2048,
3031 # The name of the ZFS pool
···19 # The NixOS configuration to be installed onto the disk image.
20 config,
2122+ # size of the FAT partition, in MiB (1024x1024 bytes).
23+ bootSize ? 1024,
2425+ # memory allocated for virtualized build instance, in MiB (1024x1024 bytes).
26 memSize ? 1024,
2728+ # The size of the root partition, in MiB (1024x1024 bytes).
29 rootSize ? 2048,
3031 # The name of the ZFS pool
+1-1
nixos/modules/config/swap.nix
···121 description = ''
122 If this option is set, ‘device’ is interpreted as the
123 path of a swapfile that will be created automatically
124- with the indicated size (in megabytes).
125 '';
126 };
127
···121 description = ''
122 If this option is set, ‘device’ is interpreted as the
123 path of a swapfile that will be created automatically
124+ with the indicated size in MiB (1024×1024 bytes).
125 '';
126 };
127
+1-2
nixos/modules/installer/sd-card/sd-image.nix
···80 type = types.int;
81 default = 8;
82 description = ''
83- Gap in front of the /boot/firmware partition, in mebibytes (1024×1024
84- bytes).
85 Can be increased to make more space for boards requiring to dd u-boot
86 SPL before actual partitions.
87
···80 type = types.int;
81 default = 8;
82 description = ''
83+ Gap in front of the /boot/firmware partition, in MiB (1024×1024 bytes).
084 Can be increased to make more space for boards requiring to dd u-boot
85 SPL before actual partitions.
86
+2-2
nixos/modules/profiles/nix-builder-vm.nix
···48 default = 20 * 1024;
49 type = types.int;
50 example = 30720;
51- description = "The maximum disk space allocated to the runner in MB";
52 };
53 memorySize = mkOption {
54 default = 3 * 1024;
55 type = types.int;
56 example = 8192;
57- description = "The runner's memory in MB";
58 };
59 min-free = mkOption {
60 default = 1024 * 1024 * 1024;
···48 default = 20 * 1024;
49 type = types.int;
50 example = 30720;
51+ description = "The maximum disk space allocated to the runner in MiB (1024×1024 bytes).";
52 };
53 memorySize = mkOption {
54 default = 3 * 1024;
55 type = types.int;
56 example = 8192;
57+ description = "The runner's memory in MiB (1024×1024 bytes).";
58 };
59 min-free = mkOption {
60 default = 1024 * 1024 * 1024;
···44 maxMemory = lib.mkOption {
45 type = lib.types.ints.unsigned;
46 default = 64;
47- description = "The maximum amount of memory to use for storage, in megabytes.";
48 };
4950 maxConnections = lib.mkOption {
···44 maxMemory = lib.mkOption {
45 type = lib.types.ints.unsigned;
46 default = 64;
47+ description = "The maximum amount of memory to use for storage, in MiB (1024×1024 bytes).";
48 };
4950 maxConnections = lib.mkOption {
+1-1
nixos/modules/virtualisation/disk-size-option.nix
···18 default = if config.virtualisation.diskSizeAutoSupported then "auto" else 1024;
19 defaultText = lib.literalExpression "if virtualisation.diskSizeAutoSupported then \"auto\" else 1024";
20 description = ''
21- The disk size in megabytes of the virtual machine.
22 '';
23 };
24 };
···18 default = if config.virtualisation.diskSizeAutoSupported then "auto" else 1024;
19 defaultText = lib.literalExpression "if virtualisation.diskSizeAutoSupported then \"auto\" else 1024";
20 description = ''
21+ The disk size in MiB (1024×1024 bytes) of the virtual machine.
22 '';
23 };
24 };
···405 type = types.ints.positive;
406 default = 1024;
407 description = ''
408- The memory size in megabytes of the virtual machine.
409 '';
410 };
411···480 default = [ ];
481 description = ''
482 Additional disk images to provide to the VM. The value is
483- a list of size in megabytes of each disk. These disks are
484 writeable by the VM.
485 '';
486 };
···1129 {
1130 assertion = pkgs.stdenv.hostPlatform.is32bit -> cfg.memorySize < 2047;
1131 message = ''
1132- virtualisation.memorySize is above 2047, but qemu is only able to allocate 2047MB RAM on 32bit max.
1133 '';
1134 }
1135 {
···405 type = types.ints.positive;
406 default = 1024;
407 description = ''
408+ The memory size of the virtual machine in MiB (1024×1024 bytes).
409 '';
410 };
411···480 default = [ ];
481 description = ''
482 Additional disk images to provide to the VM. The value is
483+ a list of size in MiB (1024×1024 bytes) of each disk. These disks are
484 writeable by the VM.
485 '';
486 };
···1129 {
1130 assertion = pkgs.stdenv.hostPlatform.is32bit -> cfg.memorySize < 2047;
1131 message = ''
1132+ virtualisation.memorySize is above 2047, but qemu is only able to allocate 2047 MiB RAM on 32bit max.
1133 '';
1134 }
1135 {
+1-1
nixos/modules/virtualisation/waagent.nix
···174 type = types.int;
175 default = 0;
176 description = ''
177- Specifies the size of the swap file in megabytes.
178179 This configuration has no effect if resource disk is managed by cloud-init.
180 '';
···174 type = types.int;
175 default = 0;
176 description = ''
177+ Specifies the size of the swap file in MiB (1024×1024 bytes).
178179 This configuration has no effect if resource disk is managed by cloud-init.
180 '';
···317 # A bash script fragment that produces a disk image at `destination`.
318 createEmptyImage =
319 {
320- # Disk image size in MiB
321 size,
322 # Name that will be written to ${destination}/nix-support/full-name
323 fullName,
···358 will build the derivation `patchelf' inside a VM. The attribute
359 `preVM' can optionally contain a shell command to be evaluated
360 *before* the VM is started (i.e., on the host). The attribute
361- `memSize' specifies the memory size of the VM in megabytes,
362- defaulting to 512. The attribute `diskImage' can optionally
363- specify a file system image to be attached to /dev/sda. (Note
364- that currently we expect the image to contain a filesystem, not a
365- full disk image with a partition table etc.)
366367 If the build fails and Nix is run with the `-K' option, a script
368 `run-vm' will be left behind in the temporary build directory
···1230 `extraPackages' specifies the names of additional packages from
1231 the distribution that should be included in the image; `packages'
1232 allows the entire set of packages to be overridden; and `size'
1233- sets the size of the disk in megabytes. E.g.,
1234 `diskImageFuns.ubuntu1004x86_64 { extraPackages = ["firefox"];
1235 size = 8192; }' builds an 8 GiB image containing Firefox in
1236 addition to the default packages.
···317 # A bash script fragment that produces a disk image at `destination`.
318 createEmptyImage =
319 {
320+ # Disk image size in MiB (1024*1024 bytes)
321 size,
322 # Name that will be written to ${destination}/nix-support/full-name
323 fullName,
···358 will build the derivation `patchelf' inside a VM. The attribute
359 `preVM' can optionally contain a shell command to be evaluated
360 *before* the VM is started (i.e., on the host). The attribute
361+ `memSize' specifies the memory size of the VM in MiB (1024*1024
362+ bytes), defaulting to 512. The attribute `diskImage' can
363+ optionally specify a file system image to be attached to /dev/sda.
364+ (Note that currently we expect the image to contain a filesystem,
365+ not a full disk image with a partition table etc.)
366367 If the build fails and Nix is run with the `-K' option, a script
368 `run-vm' will be left behind in the temporary build directory
···1230 `extraPackages' specifies the names of additional packages from
1231 the distribution that should be included in the image; `packages'
1232 allows the entire set of packages to be overridden; and `size'
1233+ sets the size of the disk in MiB (1024*1024 bytes). E.g.,
1234 `diskImageFuns.ubuntu1004x86_64 { extraPackages = ["firefox"];
1235 size = 8192; }' builds an 8 GiB image containing Firefox in
1236 addition to the default packages.
···368369 # HandleAbandonedError / SystemExit when run in sandbox
370 "test_makedirs_raises_oserror__uses_temp_dir"
0371372 # AssertionError: Not all requests have been executed
373 "test_image_refs"
···368369 # HandleAbandonedError / SystemExit when run in sandbox
370 "test_makedirs_raises_oserror__uses_temp_dir"
371+ "test_no_root_dir_access__uses_temp_dir"
372373 # AssertionError: Not all requests have been executed
374 "test_image_refs"
···567 dotnet-sdk_2 = throw "'dotnet-sdk_2' has been renamed to/replaced by 'dotnetCorePackages.sdk_2_1'"; # Converted to throw 2024-10-17
568 dotnet-sdk_3 = throw "'dotnet-sdk_3' has been renamed to/replaced by 'dotnetCorePackages.sdk_3_1'"; # Converted to throw 2024-10-17
569 dotnet-sdk_5 = throw "'dotnet-sdk_5' has been renamed to/replaced by 'dotnetCorePackages.sdk_5_0'"; # Converted to throw 2024-10-17
0570 downonspot = throw "'downonspot' was removed because upstream has been taken down by a cease and desist"; # Added 2025-01-25
571 dozenal = throw "dozenal has been removed because it does not compile and only minimal functionality"; # Added 2025-03-30
572 dstat = throw "'dstat' has been removed because it has been unmaintained since 2020. Use 'dool' instead."; # Added 2025-01-21
···1336 netbox_3_5 = throw "netbox 3.5 series has been removed as it was EOL"; # Added 2024-01-22
1337 netbox_3_7 = throw "netbox 3.7 series has been removed as it was EOL"; # Added 2025-04-23
1338 nettools = net-tools; # Added 2025-06-11
01339 nextcloud29 = throw ''
1340 Nextcloud v29 has been removed from `nixpkgs` as the support for is dropped
1341 by upstream in 2025-04. Please upgrade to at least Nextcloud v30 by declaring
···567 dotnet-sdk_2 = throw "'dotnet-sdk_2' has been renamed to/replaced by 'dotnetCorePackages.sdk_2_1'"; # Converted to throw 2024-10-17
568 dotnet-sdk_3 = throw "'dotnet-sdk_3' has been renamed to/replaced by 'dotnetCorePackages.sdk_3_1'"; # Converted to throw 2024-10-17
569 dotnet-sdk_5 = throw "'dotnet-sdk_5' has been renamed to/replaced by 'dotnetCorePackages.sdk_5_0'"; # Converted to throw 2024-10-17
570+ dotnetenv = throw "'dotnetenv' has been removed because it was unmaintained in Nixpkgs"; # Added 2025-07-11
571 downonspot = throw "'downonspot' was removed because upstream has been taken down by a cease and desist"; # Added 2025-01-25
572 dozenal = throw "dozenal has been removed because it does not compile and only minimal functionality"; # Added 2025-03-30
573 dstat = throw "'dstat' has been removed because it has been unmaintained since 2020. Use 'dool' instead."; # Added 2025-01-21
···1337 netbox_3_5 = throw "netbox 3.5 series has been removed as it was EOL"; # Added 2024-01-22
1338 netbox_3_7 = throw "netbox 3.7 series has been removed as it was EOL"; # Added 2025-04-23
1339 nettools = net-tools; # Added 2025-06-11
1340+ newt-go = fosrl-newt; # Added 2025-06-24
1341 nextcloud29 = throw ''
1342 Nextcloud v29 has been removed from `nixpkgs` as the support for is dropped
1343 by upstream in 2025-04. Please upgrade to at least Nextcloud v30 by declaring