Create options for managing disk UUIDs

This commit is contained in:
monologiq 2025-12-24 15:54:14 +01:00
parent 54c43ef2cf
commit a8f17c5c52
2 changed files with 33 additions and 4 deletions

View file

@ -40,6 +40,35 @@
modules = [ modules = [
inputs.lanzaboote.nixosModules.lanzaboote inputs.lanzaboote.nixosModules.lanzaboote
./machines/persephone.nix ./machines/persephone.nix
(
{ lib, ... }:
{
options.machines = {
fs = {
bootUUID = lib.mkOption {
type = lib.types.str;
description = "The UUID of the XBOOTLDR partition.";
default = "9c2d7380-571d-4bc5-9ad2-e4888ce351be";
};
efiUUID = lib.mkOption {
type = lib.types.str;
description = "The UUID of the ESP.";
default = "71E7-7A63";
};
luuksUUID = lib.mkOption {
type = lib.types.str;
description = "The UUID of the encrypted root partition.";
default = "b0ace3a0-64f0-461e-a604-7f6788384d12";
};
cryptrootUUID = lib.mkOption {
type = lib.types.str;
description = "The UUID of the decrypted root partition.";
default = "769362f6-43d4-4b83-a12c-d006c9bd6613";
};
};
};
}
)
]; ];
}; };

View file

@ -6,10 +6,10 @@
... ...
}: }:
let let
bootUUID = "9c2d7380-571d-4bc5-9ad2-e4888ce351be"; bootUUID = config.machines.fs.bootUUID;
efiUUID = "71E7-7A63"; efiUUID = config.machines.fs.efiUUID;
luuksUUID = "b0ace3a0-64f0-461e-a604-7f6788384d12"; luuksUUID = config.machines.fs.luuksUUID;
cryptrootUUID = "769362f6-43d4-4b83-a12c-d006c9bd6613"; cryptrootUUID = config.machines.fs.cryptrootUUID;
in in
{ {
imports = [ imports = [