disk.nix 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. { lib
  2. , inputs
  3. , ...
  4. }: {
  5. imports = [
  6. inputs.disko.nixosModules.disko
  7. ];
  8. disko.devices = {
  9. disk.disk1 = {
  10. device = lib.mkDefault "/dev/vda";
  11. type = "disk";
  12. content = {
  13. type = "gpt";
  14. partitions = {
  15. boot = {
  16. name = "boot";
  17. size = "1M";
  18. type = "EF02";
  19. };
  20. esp = {
  21. name = "ESP";
  22. size = "500M";
  23. type = "EF00";
  24. content = {
  25. type = "filesystem";
  26. format = "vfat";
  27. mountpoint = "/boot";
  28. };
  29. };
  30. root = {
  31. name = "root";
  32. size = "100%";
  33. content = {
  34. type = "lvm_pv";
  35. vg = "pool";
  36. };
  37. };
  38. };
  39. };
  40. };
  41. lvm_vg = {
  42. pool = {
  43. type = "lvm_vg";
  44. lvs = {
  45. root = {
  46. size = "100%FREE";
  47. content = {
  48. type = "filesystem";
  49. format = "ext4";
  50. mountpoint = "/";
  51. mountOptions = [
  52. "defaults"
  53. ];
  54. };
  55. };
  56. };
  57. };
  58. };
  59. };
  60. }