manual: add nixos-rebuild build-image section

phaer b79f1c3c 1d0a29c2

+16
nixos/doc/manual/installation/building-images-via-nixos-rebuild-build-image.chapter.md
···
+
# Building Images with `nixos-rebuild build-image` {#sec-image-nixos-rebuild-build-image}
+
+
Nixpkgs contains a variety of modules to build custom images for different virtualization platforms and cloud providers, such as e.g. `amazon-image.nix` and `proxmox-lxc.nix`.
+
+
While those can be imported individually, `system.build.images` provides an attribute set mapping variant names to image derivations. Available variants are defined - end extendable - in `image.modules`, an attribute set mapping variant names to a list of NixOS modules.
+
+
All of those images can be built via both, their `system.build.image` attribute, and the CLI `nixos-rebuild build-image`. To build i.e. an Amazon image from your existing NixOS configuration:
+
+
```ShellSession
+
$ nixos-rebuild build-image --image-variant amazon
+
$ ls result
+
nixos-image-amazon-25.05pre-git-x86_64-linux.vhd nix-support
+
```
+
+
To get a list of all variants available, run `nixos-rebuild build-image` without arguments.
+
+1 -3
nixos/doc/manual/installation/building-nixos.chapter.md
···
# Building a NixOS (Live) ISO {#sec-building-image}
Default live installer configurations are available inside `nixos/modules/installer/cd-dvd`.
-
For building other system images, [nixos-generators] is a good place to start looking at.
+
For building other system images, see [Building Images with `nixos-rebuild build-image`](#sec-image-nixos-rebuild-build-image).
You have two options:
···
However, if you are confident, you can opt to override those
enforced values with `mkForce`.
-
-
[nixos-generators]: https://github.com/nix-community/nixos-generators
## Practical Instructions {#sec-building-image-instructions}
+1
nixos/doc/manual/installation/installation.md
···
changing-config.chapter.md
upgrading.chapter.md
building-nixos.chapter.md
+
building-images-via-nixos-rebuild-build-image.chapter.md
building-images-via-systemd-repart.chapter.md
```
+3
nixos/doc/manual/redirects.json
···
"sec-building-image-tech-notes": [
"index.html#sec-building-image-tech-notes"
],
+
"sec-image-nixos-rebuild-build-image": [
+
"index.html#sec-image-nixos-rebuild-build-image"
+
],
"sec-image-repart": [
"index.html#sec-image-repart"
],