about summary refs log tree commit diff
path: root/nixos/modules/image
diff options
context:
space:
mode:
authorVincent Haupert <vincent@yaxi.tech>2023-08-01 18:08:29 +0200
committerVincent Haupert <vincent@yaxi.tech>2023-08-02 00:10:14 +0200
commit7f70abf80ce03ac5b25175df57fe73eb71d20966 (patch)
tree4bb995d48adc60d61377bde99a44d46fd7038cdd /nixos/modules/image
parent7ecf45587a21a0ce513ef773d482b2091b3644ac (diff)
nixos/image: write `systemd-repart` output to `$out/repart-output.json`
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).
Diffstat (limited to 'nixos/modules/image')
-rw-r--r--nixos/modules/image/repart.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/nixos/modules/image/repart.nix b/nixos/modules/image/repart.nix
index 9e7fe6932b317..4362982f5bac7 100644
--- a/nixos/modules/image/repart.nix
+++ b/nixos/modules/image/repart.nix
@@ -195,7 +195,9 @@ in
           --seed="${cfg.seed}" \
           --definitions="$amendedRepartDefinitions" \
           --split="${lib.boolToString cfg.split}" \
-          image.raw
+          --json=pretty \
+          image.raw \
+          | tee repart-output.json
       '';
 
     meta = {