about summary refs log tree commit diff
path: root/nixos/modules/image
AgeCommit message (Collapse)AuthorFilesLines
2024-04-13nixos: remove all uses of lib.mdDocstuebinm1-18/+18
these changes were generated with nixq 0.0.2, by running nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix two mentions of the mdDoc function remain in nixos/, both of which are inside of comments. Since lib.mdDoc is already defined as just id, this commit is a no-op as far as Nix (and the built manual) is concerned.
2024-04-08Merge pull request #302590 from nikstur/repart-image-label-lengthnikstur1-0/+38
nixos/image/repart: assert maximum label length
2024-04-08nixos/image/repart: assert maximum label lengthnikstur1-0/+38
The maximum label length is specified by UEFI and enforced/asserted by systemd-repart. This lets evaluation fail already and give the user some more information about what's wrong. Also warn when the suggested label length is exceeded. This serves as a safety mechanism for using systemd-sysupdate style A/B updates where the version number is encoded in the label and might not be incrementable when the maximum label size is reached.
2024-04-04nixos/repart-image: supply explicit --architecture to repartnikstur1-0/+20
This enables cross-compiling images.
2024-03-21nixos/repart-image: add myself as maintainerWilliButz1-1/+1
2024-03-21nixos/repart-image: add internal option to expose finalPartitionsWilliButz1-13/+23
2024-03-21nixos/repart-image: refactor to use mkDerivationWilliButz2-29/+62
As a follow-up to https://github.com/NixOS/nixpkgs/pull/294096 this should further improve the flexibility around building OS images with systemd-repart: * Previously the attribute set `compression` needed to be fully populated, including `algorithm` and `level` because `compression.enable` was evaluated by bash, after being interpolated as strings into the `buildCommand`. Now it's sufficient to pass `compression.enable = false` to the builder, e.g. in `overrideAttrs`, to disable the compression. * Using mkDerivation allows for much more customization than the previously used `runCommand`, making use of phases and pre/post hooks. This is especially helpful for building multiple images from the same system configuration, e.g. to build an image `Y` based on a partially built raw image `X`, by injecting a UKI that depends on `X` into a defered ESP. * Before this change it was non-trivial to conduct further manipulations on the amended repart definitions. Now, the definitions that systemd-repart uses to build the image can be easily manipulated in `postPatch` or `preBuild`. Aside from this, the build is now executed in the build directory, rather than `$out`. This allows references to relative paths in the build environment to be used, especially for `--definitions`, which previously required an absolute path.
2024-03-07nixos/repart-image: add options to specify mkfs parametersWilliButz2-1/+34
This new option makes it easier to specify extra mkfs parameters for the systemd-repart builder. See https://github.com/systemd/systemd/blob/v255/docs/ENVIRONMENT.md?plain=1#L575-L577
2024-03-07nixos/repart-image: improve overridability, use structuredAttrsWilliButz1-10/+25
Parameters passed to systemd-repart are now passed to the build script via environment variable, which is defined as a list of strings in combination with `__structuredAttrs = true`. This should make it easier to customize the image build using `overrideAttrs`. Both the script used to amend the repart definitions and the amended definitions are now available via passthru.
2024-01-27nixos/repart: add option for configuring sector sizeJared Baur2-1/+13
This option is helpful for situations when the target host disk's sector size differs from that of the build host.
2024-01-19image/repart: add version and compression optionsnikstur2-5/+107
The version option is needed if you want to implement partition & systemd-boot based A/B booting where the version information is encoded in the files on the ESP. See systemd-sysupate docs for more details on this: https://www.freedesktop.org/software/systemd/man/latest/sysupdate.d.html Note, however, that this is not *only* useful for systemd-sysupdate but also for other similar updating tools/mechanisms.
2023-12-21image/repart: build image with buildPackagesJared Baur2-53/+89
Since the repart image is built on the build platform, use `buildPackages` to construct the image. This allows for systemd-repart images for cross-compiled nixos configurations to work properly.
2023-10-31nixos/image: fix layout of option examples in repart buildernikstur1-22/+24
2023-10-31nixos/image: move docs into manualnikstur2-141/+1
2023-10-31nixos/image: fix documentation buildJulian Stecklina1-3/+1
literalExpression triggers the following error when building the manual: Cacheable portion of option doc build failed. Usually this means that an option attribute that ends up in documentation (eg `default` or `description`) depends on the restricted module arguments `config` or `pkgs`.
2023-09-13nixos/image: fix for systemd 254nikstur1-1/+2
2023-08-22modules/image/repart: Fix stripNixStorePrefixArian van Putten1-2/+2
It seems it wasn't working
2023-08-04nixos/image: add `image.repart.package` optionVincent Haupert1-3/+10
Allow giving a custom package containing the `systemd-repart` binary. Defaults to `pkgs.systemd`. This option opens up the possibility to use a different package for the image builder and the system configuration. For example, someone could use this option to build an image with a patched systemd while still using the upstream nixpkgs systemd package (i.e., `pkgs.systemd`) for the system configuration installed to the created image.
2023-08-03nixos/image: use stable target dir for amended repart definitionsVincent Haupert1-7/+6
Output the amended repart definitions to a well-known directory in $TMPDIR instead of using a temporary directory with a random directory name. The output file `repart-output.json` also contains the full path to the repart definition file used to create the partition. As `amend-repart-definitions.py` uses `tempfile.mkdtemp`, this introduces an impurity: ```json { "type" : "root-x86-64", "label" : "rootfs", "uuid" : "f2fa2e49-e443-45d2-a2e2-c3754cab6363", "file" : "/build/tmppjo7kv5o/rootfs.conf", "node" : "image.raw2", "offset" : 135266304, "old_size" : 0, "raw_size" : 1651101696, "old_padding" : 0, "raw_padding" : 0, "activity" : "create", } ``` This commit changes the parent directory of the amended repart definitions to `/build/amended-repart.d/`.
2023-08-02nixos/image: write `systemd-repart` output to `$out/repart-output.json`Vincent Haupert1-1/+3
Write the output of `systemd-repart` as a JSON file to `$out/repart-output.json`. Depending on the repart configuration, the output of `systemd-repart` contains important information, for example, when creating verity partitions: > The verity root hash itself will be included in the output of > systemd-repart. See `Verity=` in repart.d(5).
2023-07-26nixos/image: add repart builder docsnikstur2-1/+141
2023-07-26nixos/image: add repart buildernikstur2-0/+317