mirror of
https://github.com/nix-community/disko
synced 2024-11-10 06:14:14 +00:00
68eb09b183
The settings submodule mirrors the options which can be set for boot.initrd.luks.devices.<name>. The keyFile option is now deprecated and should be declared under settings.
76 lines
1.9 KiB
Nix
76 lines
1.9 KiB
Nix
{ disks ? [ "/dev/vdb" ], ... }: {
|
|
disko.devices = {
|
|
disk = {
|
|
vdb = {
|
|
type = "disk";
|
|
device = builtins.elemAt disks 0;
|
|
content = {
|
|
type = "table";
|
|
format = "gpt";
|
|
partitions = [
|
|
{
|
|
name = "ESP";
|
|
start = "1MiB";
|
|
end = "100MiB";
|
|
bootable = true;
|
|
content = {
|
|
type = "filesystem";
|
|
format = "vfat";
|
|
mountpoint = "/boot";
|
|
mountOptions = [
|
|
"defaults"
|
|
];
|
|
};
|
|
}
|
|
{
|
|
name = "luks";
|
|
start = "100MiB";
|
|
end = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "crypted";
|
|
extraOpenArgs = [ "--allow-discards" ];
|
|
# if you want to use the key for interactive login be sure there is no trailing newline
|
|
# for example use `echo -n "password" > /tmp/secret.key`
|
|
settings.keyFile = "/tmp/secret.key";
|
|
content = {
|
|
type = "lvm_pv";
|
|
vg = "pool";
|
|
};
|
|
};
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
lvm_vg = {
|
|
pool = {
|
|
type = "lvm_vg";
|
|
lvs = {
|
|
root = {
|
|
size = "100M";
|
|
content = {
|
|
type = "filesystem";
|
|
format = "ext4";
|
|
mountpoint = "/";
|
|
mountOptions = [
|
|
"defaults"
|
|
];
|
|
};
|
|
};
|
|
home = {
|
|
size = "10M";
|
|
content = {
|
|
type = "filesystem";
|
|
format = "ext4";
|
|
mountpoint = "/home";
|
|
};
|
|
};
|
|
raw = {
|
|
size = "10M";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|