{ 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; }; }; }; }; }; }; }; }