disko.nix 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. let
  2. btrfs.mountOptions = [ "compress=zstd" ];
  3. in {
  4. disko.devices = {
  5. disk = {
  6. main = {
  7. device = "/dev/disk/by-id/nvme-SAMSUNG_MZAL4256HBJD-00BL2_S67PNE0W629245";
  8. type = "disk";
  9. content = {
  10. type = "gpt";
  11. partitions = {
  12. ESP = {
  13. size = "1G";
  14. type = "EF00";
  15. content = {
  16. type = "filesystem";
  17. format = "vfat";
  18. mountpoint = "/boot";
  19. };
  20. };
  21. luks-swap = {
  22. size = "12G";
  23. content = {
  24. type = "luks";
  25. name = "crypted-swap";
  26. settings.allowDiscards = true;
  27. content = {
  28. type = "swap";
  29. discardPolicy = "both";
  30. };
  31. };
  32. };
  33. luks-system = {
  34. size = "100%";
  35. content = {
  36. type = "luks";
  37. name = "crypted-system";
  38. settings.allowDiscards = true;
  39. content = {
  40. type = "btrfs";
  41. mountpoint = "/system";
  42. inherit (btrfs) mountOptions;
  43. subvolumes = {
  44. "/home" = {
  45. inherit (btrfs) mountOptions;
  46. mountpoint = "/home";
  47. };
  48. "/nix" = {
  49. inherit (btrfs) mountOptions;
  50. mountpoint = "/nix";
  51. };
  52. "/persist" = {};
  53. };
  54. };
  55. };
  56. };
  57. };
  58. };
  59. };
  60. };
  61. nodev."/" = {
  62. fsType = "tmpfs";
  63. mountOptions = [ "size=256M" "mode=755" ];
  64. };
  65. };
  66. }