For most users of nixos-generate zstd will be the better choice as
it will build and boot images much faster. Often users have to rebuild
images a couple of times before they are happy with the result.
NixOS might be better of with xz as it saves download and storage cost
for images.
Many formats generate an image only large enough for the generated NixOS
config. This quickly runs out of space for NixOS servers that are updated
over time rather than being redeployed with fresh images.
Signed-off-by: James Alseth <james@jalseth.me>
In af3d3a7538, filename was renamed to fileExtension and used in find -name. This breaks kexec as it used to have the actual file name glob in there.
Given it's the only file produced it seems safe to just remove the path component.
Builds `result/nixos.img.gz` image which can be uploaded and run
directly on Linode without an installation process.
Known working settings when setting up Linode:
Configure two disks:
- Label: /dev/sda Filesystem: ext4 (from uploaded .img.gz image)
- Label: /dev/sdb Filesystem: swap
Create configuration:
- VM Mode: Paravirtualization
- Kernel: GRUB 2
- Run Level: Run Default Level
- Memory Limit: Do not set any limits on memory usage
- Block Device Assignment:
- - /dev/sda -> /dev/sda
- - /dev/sdb -> /dev/sdb
- Use custom root: No
- Root device: /dev/sda
- Enable distro helper: No
- Disable updatedb: No
- Enable modules.dep helper: No
- Auto-mount devtmpfs: No
- Auto-configure networking: No
Using information from:
- https://www.linode.com/docs/guides/install-nixos-on-linode/
- https://gist.github.com/nixy/e964240d301e0db513463f11bbb22d26
- https://gist.github.com/nocoolnametom/a359624afce4278f16e2760fe65468cc
on nixpkgs versions prior to the commit that changed
config.system.build's type from a lazy attribute set to a submodule.
Prior to this type change, there is no system.build.kexec_tarball option
declared, so the NixOS module system does not resolve
priorities/overrides in the config.build.kexec_tarball definition.
That is, with lib.mkForce, the config.build.kexec_tarball definition
ends up being something like:
{
_type = "override";
content = <...>;
priority = 50;
}
Removing lib.mkForce allows us to successfully and sensibly interpolate
the value (== outPath) of system.build.kexec_tarball in
system.build.kexec_bundle's builder script.
Likewise, no lib.mkOverride for system.build.raw.