nix/nixos/hosts/osaka-vultr-01/disks.nix
2023-10-05 18:20:33 +09:00

50 lines
No EOL
1.4 KiB
Nix

{
boot.loader.grub = {
enable = true;
device = "/dev/vda1";
enableCryptodisk = true;
};
boot.initrd.luks.devices."DISK".device = "/dev/vda2";
services.btrfs.autoScrub.enable = true;
services.btrfs.autoScrub.interval = "weekly";
disko.devices.disk.vda = {
device = "/dev/vda";
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02";
}; # partitions.boot
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted";
extraOpenArgs = [ "--allow-discards" ];
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
}; # root
"/home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" ];
}; # home
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
}; # nix
}; # subvolumes
};# content
}; # content
}; # luks.partitions
}; # partitions
}; # content
}; # disko.devices.disk.vda
} # root