0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 13:40:28 +03:00

treewide: specify where mebibytes are used when it's ambiguous

This commit is contained in:
Axel Karjalainen 2025-07-11 00:44:23 +03:00
parent dd082b8161
commit 7159ab6f43
16 changed files with 32 additions and 33 deletions

View file

@ -145,14 +145,14 @@ Similarly, if you encounter errors similar to `Error_Protocol ("certificate has
`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.

View file

@ -108,6 +108,6 @@ make-disk-image {
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.
}
```

View file

@ -23,7 +23,7 @@ If the build fails and Nix is run with the `-K/--keep-failed` option, a script `
### 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.

View file

@ -92,7 +92,7 @@ There are a few special NixOS options for test VMs:
`virtualisation.memorySize`
: The memory of the VM in megabytes.
: The memory of the VM in MiB (1024×1024 bytes).
`virtualisation.vlans`

View file

@ -96,7 +96,7 @@
# 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",
@ -152,7 +152,7 @@
# 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

View file

@ -30,10 +30,10 @@
# 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
@ -74,7 +74,7 @@
# 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",

View file

@ -19,13 +19,13 @@
# 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

View file

@ -121,7 +121,7 @@ let
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).
'';
};

View file

@ -80,8 +80,7 @@ in
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.

View file

@ -48,13 +48,13 @@ in
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;

View file

@ -44,7 +44,7 @@ in
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 {

View file

@ -18,7 +18,7 @@ in
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.
'';
};
};

View file

@ -71,7 +71,7 @@ with lib;
type = types.ints.positive;
default = 1024;
description = ''
Guest memory in MB
Guest memory in MiB (1024×1024 bytes)
'';
};
bios = mkOption {

View file

@ -391,7 +391,7 @@ in
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).
'';
};
@ -457,7 +457,7 @@ in
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.
'';
};
@ -1098,7 +1098,7 @@ in
{
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.
'';
}
{

View file

@ -174,7 +174,7 @@ let
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.
'';

View file

@ -317,7 +317,7 @@ rec {
# 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,
@ -358,11 +358,11 @@ rec {
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
@ -1230,7 +1230,7 @@ rec {
`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.