refactor: make luks names predictable

This commit is contained in:
oddlama 2024-01-05 13:29:46 +01:00
parent 490e2ce1a5
commit 664cb45a08
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
14 changed files with 68 additions and 61 deletions

View file

@ -2,19 +2,21 @@
config,
lib,
...
}: {
}: let
inherit (config.repo.secrets.local) disks;
in {
disko.devices = {
disk = {
main = {
${disks.main} = {
type = "disk";
device = "/dev/disk/by-id/${config.repo.secrets.local.disk.main}";
device = "/dev/disk/by-id/${disks.main}";
content = with lib.disko.gpt; {
type = "table";
format = "gpt";
partitions = [
(partGrub "grub" "0%" "1MiB")
(partEfi "bios" "1MiB" "512MiB")
(partLuksZfs "rpool" "512MiB" "100%")
(partLuksZfs disks.main "rpool" "512MiB" "100%")
];
};
};
@ -24,6 +26,5 @@
};
};
boot.loader.grub.devices = ["/dev/disk/by-id/${config.repo.secrets.local.disk.main}"];
boot.initrd.luks.devices.enc-rpool.allowDiscards = true;
boot.loader.grub.devices = ["/dev/disk/by-id/${disks.main}"];
}