nixos/hosts/common/disks/luks.nix

41 lines
928 B
Nix
Raw Normal View History

2024-06-28 20:21:27 +01:00
{
device ? throw "Must define a device, e.g. /dev/sda",
fsModule ? "Must specify submodule"
}:
2024-05-27 15:42:50 +01:00
{
disko.devices = {
disk = {
vdb = {
type = "disk";
inherit device;
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted";
passwordFile = "/tmp/luks_secret.key"; # Interactive
2024-06-28 20:21:27 +01:00
content = (import "${fsModule}");
2024-05-27 15:42:50 +01:00
};
};
};
};
};
};
};
}