nixos configurations
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.6 KiB

4 months ago
  1. {
  2. device ? throw "Set this to your disk device, e.g. /dev/disk/by-id/id",
  3. swapSize ? "8G",
  4. ...
  5. }: {
  6. disko.devices = {
  7. disk.main = {
  8. inherit device;
  9. type = "disk";
  10. content = {
  11. type = "gpt";
  12. partitions = {
  13. ESP = {
  14. name = "boot";
  15. size = "500M";
  16. type = "EF00";
  17. content = {
  18. type = "filesystem";
  19. format = "vfat";
  20. mountOptions = [ "fmask=0022" "dmask=0022" ];
  21. mountpoint = "/boot";
  22. };
  23. };
  24. root = {
  25. name = "root";
  26. size = "100%";
  27. content = {
  28. type = "luks";
  29. name = "crypted";
  30. settings.allowDiscards = true;
  31. passwordFile = "/tmp/secret.key";
  32. content = {
  33. type = "btrfs";
  34. extraArgs = [ "-f" ];
  35. subvolumes = {
  36. "/root" = {
  37. mountOptions = [ "compress=zstd" ];
  38. mountpoint = "/";
  39. };
  40. "/home" = {
  41. mountOptions = [ "compress=zstd" ];
  42. mountpoint = "/home";
  43. };
  44. "/nix" = {
  45. mountOptions = [ "compress=zstd" ];
  46. mountpoint = "/nix";
  47. };
  48. "/swap" = {
  49. mountOptions = [ "noatime" ];
  50. mountpoint = "/swap";
  51. swap.swapfile.size = swapSize;
  52. };
  53. };
  54. };
  55. };
  56. };
  57. };
  58. };
  59. };
  60. };
  61. }