nix-config/hosts/maddy/fs.nix

35 lines
1 KiB
Nix
Raw Normal View History

2024-07-26 22:12:48 +02:00
{ config, lib, ... }:
2023-12-22 23:53:11 +01:00
{
disko.devices = {
disk = {
2024-03-02 16:09:11 +01:00
drive = rec {
2023-12-22 23:53:11 +01:00
type = "disk";
device = "/dev/disk/by-id/${config.secrets.secrets.local.disko.drive}";
content = with lib.disko.gpt; {
2024-03-02 16:09:11 +01:00
type = "gpt";
partitions = {
2024-07-26 22:12:48 +02:00
grub = partGrub // {
device = "${device}-part1";
};
bios = (partEfi "512MiB") // {
device = "${device}-part2";
};
rpool = (partLuksZfs "rpool" "rpool" "100%") // {
device = "${device}-part3";
};
2023-12-22 23:53:11 +01:00
#(lib.attrsets.recursiveUpdate (partLuksZfs "rpool" "rpool" "17GiB" "100%") {content.extraFormatArgs = ["--pbkdf pbkdf2"];})
2024-03-02 16:09:11 +01:00
};
2023-12-22 23:53:11 +01:00
};
};
};
zpool = with lib.disko.zfs; {
2024-07-26 22:12:48 +02:00
rpool = mkZpool { datasets = impermanenceZfsDatasets; };
2023-12-22 23:53:11 +01:00
};
};
fileSystems."/state".neededForBoot = true;
fileSystems."/persist".neededForBoot = true;
2024-07-26 22:12:48 +02:00
boot.loader.grub.devices = [ "/dev/disk/by-id/${config.secrets.secrets.local.disko.drive}" ];
2023-12-22 23:53:11 +01:00
}