treewide: specify that mebibytes are used when it's ambiguous (#424169)

Changed files
+32 -33
doc
nixos
pkgs
build-support
+2 -2
doc/build-helpers/images/dockertools.section.md
···
`diskSize` (Number; _optional_)
-
: Controls the disk size (in megabytes) of the VM used to run the script specified in `runAsRoot`.
+
: Controls the disk size in MiB (1024x1024 bytes) of the VM used to run the script specified in `runAsRoot`.
This attribute is ignored if `runAsRoot` is `null`.
_Default value:_ 1024.
`buildVMMemorySize` (Number; _optional_)
-
: Controls the amount of memory (in megabytes) provisioned for the VM used to run the script specified in `runAsRoot`.
+
: Controls the amount of memory in MiB (1024x1024 bytes) provisioned for the VM used to run the script specified in `runAsRoot`.
This attribute is ignored if `runAsRoot` is `null`.
_Default value:_ 512.
+1 -1
doc/build-helpers/images/makediskimage.section.md
···
diskSize = "auto";
additionalSpace = "0M"; # Defaults to 512M.
copyChannel = false;
-
memSize = 2048; # Qemu VM memory size in megabytes. Defaults to 1024M.
+
memSize = 2048; # Qemu VM memory size in MiB (1024*1024 bytes). Defaults to 1024M.
}
```
+1 -1
doc/build-helpers/special/vm-tools.section.md
···
### Attributes {#vm-tools-runInLinuxVM-attributes}
* `preVM` (optional). Shell command to be evaluated *before* the VM is started (i.e., on the host).
-
* `memSize` (optional, default `512`). The memory size of the VM in MiB.
+
* `memSize` (optional, default `512`). The memory size of the VM in MiB (1024×1024 bytes).
* `diskImage` (optional). A file system image to be attached to `/dev/sda`.
Note that currently we expect the image to contain a filesystem, not a full disk image with a partition table etc.
+1 -1
nixos/doc/manual/development/writing-nixos-tests.section.md
···
`virtualisation.memorySize`
-
: The memory of the VM in megabytes.
+
: The memory of the VM in MiB (1024×1024 bytes).
`virtualisation.vlans`
+2 -2
nixos/lib/make-disk-image.nix
···
# The NixOS configuration to be installed onto the disk image.
config,
-
# The size of the disk, in megabytes.
+
# The size of the disk, in MiB (1024*1024 bytes).
# if "auto" size is calculated based on the contents copied to it and
# additionalSpace is taken into account.
diskSize ? "auto",
···
# Shell code executed after the VM has finished.
postVM ? "",
-
# Guest memory size
+
# Guest memory size in MiB (1024*1024 bytes)
memSize ? 1024,
# Copy the contents of the Nix store to the root of the image and
+3 -3
nixos/lib/make-multi-disk-zfs-image.nix
···
# The NixOS configuration to be installed onto the disk image.
config,
-
# size of the FAT boot disk, in megabytes.
+
# size of the FAT boot disk in MiB (1024*1024 bytes)
bootSize ? 1024,
-
# The size of the root disk, in megabytes.
+
# The size of the root disk in MiB (1024*1024 bytes)
rootSize ? 2048,
# The name of the ZFS pool
···
# Shell code executed after the VM has finished.
postVM ? "",
-
# Guest memory size
+
# Guest memory size in MiB (1024*1024 bytes)
memSize ? 1024,
name ? "nixos-disk-image",
+4 -4
nixos/lib/make-single-disk-zfs-image.nix
···
# The NixOS configuration to be installed onto the disk image.
config,
-
# size of the FAT partition, in megabytes.
-
bootSize ? 1024
+
# size of the FAT partition, in MiB (1024x1024 bytes).
+
bootSize ? 1024,
-
, # memory allocated for virtualized build instance
+
# memory allocated for virtualized build instance, in MiB (1024x1024 bytes).
memSize ? 1024,
-
# The size of the root partition, in megabytes.
+
# The size of the root partition, in MiB (1024x1024 bytes).
rootSize ? 2048,
# The name of the ZFS pool
+1 -1
nixos/modules/config/swap.nix
···
description = ''
If this option is set, ‘device’ is interpreted as the
path of a swapfile that will be created automatically
-
with the indicated size (in megabytes).
+
with the indicated size in MiB (1024×1024 bytes).
'';
};
+1 -2
nixos/modules/installer/sd-card/sd-image.nix
···
type = types.int;
default = 8;
description = ''
-
Gap in front of the /boot/firmware partition, in mebibytes (1024×1024
-
bytes).
+
Gap in front of the /boot/firmware partition, in MiB (1024×1024 bytes).
Can be increased to make more space for boards requiring to dd u-boot
SPL before actual partitions.
+2 -2
nixos/modules/profiles/nix-builder-vm.nix
···
default = 20 * 1024;
type = types.int;
example = 30720;
-
description = "The maximum disk space allocated to the runner in MB";
+
description = "The maximum disk space allocated to the runner in MiB (1024×1024 bytes).";
};
memorySize = mkOption {
default = 3 * 1024;
type = types.int;
example = 8192;
-
description = "The runner's memory in MB";
+
description = "The runner's memory in MiB (1024×1024 bytes).";
};
min-free = mkOption {
default = 1024 * 1024 * 1024;
+1 -1
nixos/modules/services/databases/memcached.nix
···
maxMemory = lib.mkOption {
type = lib.types.ints.unsigned;
default = 64;
-
description = "The maximum amount of memory to use for storage, in megabytes.";
+
description = "The maximum amount of memory to use for storage, in MiB (1024×1024 bytes).";
};
maxConnections = lib.mkOption {
+1 -1
nixos/modules/virtualisation/disk-size-option.nix
···
default = if config.virtualisation.diskSizeAutoSupported then "auto" else 1024;
defaultText = lib.literalExpression "if virtualisation.diskSizeAutoSupported then \"auto\" else 1024";
description = ''
-
The disk size in megabytes of the virtual machine.
+
The disk size in MiB (1024×1024 bytes) of the virtual machine.
'';
};
};
+1 -1
nixos/modules/virtualisation/proxmox-image.nix
···
type = types.ints.positive;
default = 1024;
description = ''
-
Guest memory in MB
+
Guest memory in MiB (1024×1024 bytes)
'';
};
bios = mkOption {
+3 -3
nixos/modules/virtualisation/qemu-vm.nix
···
type = types.ints.positive;
default = 1024;
description = ''
-
The memory size in megabytes of the virtual machine.
+
The memory size of the virtual machine in MiB (1024×1024 bytes).
'';
};
···
default = [ ];
description = ''
Additional disk images to provide to the VM. The value is
-
a list of size in megabytes of each disk. These disks are
+
a list of size in MiB (1024×1024 bytes) of each disk. These disks are
writeable by the VM.
'';
};
···
assertion = pkgs.stdenv.hostPlatform.is32bit -> cfg.memorySize < 2047;
message = ''
-
virtualisation.memorySize is above 2047, but qemu is only able to allocate 2047MB RAM on 32bit max.
+
virtualisation.memorySize is above 2047, but qemu is only able to allocate 2047 MiB RAM on 32bit max.
'';
+1 -1
nixos/modules/virtualisation/waagent.nix
···
type = types.int;
default = 0;
description = ''
-
Specifies the size of the swap file in megabytes.
+
Specifies the size of the swap file in MiB (1024×1024 bytes).
This configuration has no effect if resource disk is managed by cloud-init.
'';
+7 -7
pkgs/build-support/vm/default.nix
···
# A bash script fragment that produces a disk image at `destination`.
createEmptyImage =
{
-
# Disk image size in MiB
+
# Disk image size in MiB (1024*1024 bytes)
size,
# Name that will be written to ${destination}/nix-support/full-name
fullName,
···
will build the derivation `patchelf' inside a VM. The attribute
`preVM' can optionally contain a shell command to be evaluated
*before* the VM is started (i.e., on the host). The attribute
-
`memSize' specifies the memory size of the VM in megabytes,
-
defaulting to 512. The attribute `diskImage' can optionally
-
specify a file system image to be attached to /dev/sda. (Note
-
that currently we expect the image to contain a filesystem, not a
-
full disk image with a partition table etc.)
+
`memSize' specifies the memory size of the VM in MiB (1024*1024
+
bytes), defaulting to 512. The attribute `diskImage' can
+
optionally specify a file system image to be attached to /dev/sda.
+
(Note that currently we expect the image to contain a filesystem,
+
not a full disk image with a partition table etc.)
If the build fails and Nix is run with the `-K' option, a script
`run-vm' will be left behind in the temporary build directory
···
`extraPackages' specifies the names of additional packages from
the distribution that should be included in the image; `packages'
allows the entire set of packages to be overridden; and `size'
-
sets the size of the disk in megabytes. E.g.,
+
sets the size of the disk in MiB (1024*1024 bytes). E.g.,
`diskImageFuns.ubuntu1004x86_64 { extraPackages = ["firefox"];
size = 8192; }' builds an 8 GiB image containing Firefox in
addition to the default packages.