Files
nixos-blueprint/hosts/dunamis/disko/disk-main.nix
2025-07-12 15:15:12 +03:00

63 lines
1.4 KiB
Nix

{
disk,
hostId,
}: {
type = "disk";
device = disk;
content = {
type = "gpt";
partitions = {
ESP = {
size = "2G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"umask=0077"
"fmask=0022"
"dmask=0022"
"noexec"
"nosuid"
"nodev"
];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "luks-" + hostId;
initrdUnlock = true;
settings.allowDiscards = true;
content = let
mountOptions = ["autodefrag" "compress-force=zstd" "noatime"];
in {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"@nixos-root" = {
mountpoint = "/";
mountOptions = mountOptions ++ ["noexec"];
};
"@home" = {
mountpoint = "/home";
inherit mountOptions;
};
"@storage" = {
mountpoint = "/storage";
inherit mountOptions;
};
"@nix" = {
mountpoint = "/nix";
inherit mountOptions;
};
};
};
};
};
};
};
}