0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 22:20:30 +03:00

nixos/repart-image: don't pass seed when it's null, update documentation

From systemd-repart(8):

If not specified it is attempted to read the machine ID from the host
(or more precisely, the root directory configured via --root=) and use
it as seed instead, falling back to a randomized seed otherwise. Use
--seed=random to force a randomized seed.

The option documentation now suggests the special value "random", for
a random seed rather than relying on the implicit fact that there is
no machine ID available in the build sandbox, causing repart to fallback
on generating a random seed.

Fixes #419331
This commit is contained in:
WilliButz 2025-06-23 20:08:28 +02:00
parent d079709547
commit ed5f0fbfcd
No known key found for this signature in database
GPG key ID: AB05DF703EB9DC70
2 changed files with 5 additions and 2 deletions

View file

@ -173,11 +173,13 @@ stdenvNoCC.mkDerivation (
"--architecture=${systemdArch}"
"--dry-run=no"
"--size=auto"
"--seed=${seed}"
"--definitions=${finalAttrs.finalRepartDefinitions}"
"--split=${lib.boolToString split}"
"--json=pretty"
]
++ lib.optionals (seed != null) [
"--seed=${seed}"
]
++ lib.optionals createEmpty [
"--empty=create"
]

View file

@ -161,8 +161,9 @@ in
# Generated with `uuidgen`. Random but fixed to improve reproducibility.
default = "0867da16-f251-457d-a9e8-c31f9a3c220b";
description = ''
A UUID to use as a seed. You can set this to `null` to explicitly
A UUID to use as a seed. You can set this to `random` to explicitly
randomize the partition UUIDs.
See {manpage}`systemd-repart(8)` for more information.
'';
};