NixOS deployment for LinuxLab
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.

66 lines
1.2 KiB

1 week ago
2 weeks ago
2 weeks ago
1 week ago
2 weeks ago
  1. { pkgs, lib, ... }:
  2. with lib;
  3. {
  4. services.nfs.server = {
  5. enable = true;
  6. exports = ''
  7. /home 10.33.64.0/20(rw,async,no_root_squash)
  8. '';
  9. };
  10. networking.firewall.allowedTCPPorts = [
  11. 2049 # NFSv4
  12. ];
  13. environment.systemPackages = with pkgs; [
  14. quota
  15. ];
  16. disko.devices = {
  17. disk = genAttrs [
  18. "pci-0000:00:17.0-ata-1"
  19. "pci-0000:00:17.0-ata-2"
  20. "pci-0000:00:17.0-ata-3"
  21. "pci-0000:00:17.0-ata-4"
  22. ]
  23. (path: {
  24. type = "disk";
  25. device = "/dev/disk/by-path/${path}";
  26. content = {
  27. type = "mdraid";
  28. name = "home";
  29. };
  30. });
  31. mdadm = {
  32. home = {
  33. type = "mdadm";
  34. level = 5;
  35. content = {
  36. type = "gpt";
  37. partitions = {
  38. primary = {
  39. size = "100%";
  40. content = {
  41. type = "filesystem";
  42. format = "ext4";
  43. mountpoint = "/home";
  44. extraArgs = [
  45. "-Oquota"
  46. "-Equotatype=usrquota"
  47. ];
  48. mountOptions = [
  49. "defaults"
  50. "quota"
  51. ];
  52. };
  53. };
  54. };
  55. };
  56. };
  57. };
  58. };
  59. }