nix-config/hosts/desktopnix/fs.nix

51 lines
1.4 KiB
Nix
Raw Normal View History

2023-08-30 14:25:52 +02:00
{
config,
lib,
...
}: {
disko.devices = {
disk = {
m2-ssd = {
type = "disk";
2023-08-30 20:18:26 +02:00
device = "/dev/disk/by-id/${config.secrets.secrets.local.disko.m2-ssd}";
2023-08-30 14:25:52 +02:00
content = with lib.disko.gpt; {
type = "table";
format = "gpt";
partitions = [
2023-10-10 21:01:12 +02:00
(partEfiBoot "boot" "0%" "2GiB")
(partSwap "swap" "2GiB" "18GiB")
(partLuksZfs "rpool" "rpool" "18GiB" "100%")
2023-08-30 14:25:52 +02:00
];
};
};
sata-hdd = {
type = "disk";
2023-08-30 20:18:26 +02:00
device = "/dev/disk/by-id/${config.secrets.secrets.local.disko.sata-hdd}";
2023-08-30 14:25:52 +02:00
content = with lib.disko.gpt; {
type = "table";
format = "gpt";
partitions = [
2023-08-31 22:34:22 +02:00
(partLuksZfs "panzer" "panzer" "0%" "100%")
2023-08-30 14:25:52 +02:00
];
};
};
};
zpool = with lib.disko.zfs; {
rpool = defaultZpoolOptions // {datasets = defaultZfsDatasets;};
panzer =
defaultZpoolOptions
// {
datasets = {
"local" = unmountable;
"local/state" = filesystem "/panzer/state";
};
};
2023-08-30 14:25:52 +02:00
};
};
fileSystems."/state".neededForBoot = true;
fileSystems."/persist".neededForBoot = true;
fileSystems."/panzer/state".neededForBoot = true;
boot.initrd.luks.devices.enc-rpool.allowDiscards = true;
boot.initrd.luks.devices.enc-panzer.allowDiscards = true;
2023-08-30 14:25:52 +02:00
}