1
0

default.nix 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. { config
  2. , lib
  3. , pkgs
  4. , outputs
  5. , ...
  6. }:
  7. {
  8. imports = [
  9. # TODO: auto-import via `outputs.modules.nixos`
  10. outputs.modules.global.nix-config
  11. ./system
  12. ./services
  13. ./users
  14. ]
  15. ++ (builtins.attrValues outputs.modules.nixos);
  16. security.sudo.wheelNeedsPassword = false;
  17. # Services configuration
  18. services = {
  19. openssh = {
  20. enable = true;
  21. openFirewall = true;
  22. settings = {
  23. PasswordAuthentication = false;
  24. PermitRootLogin = "no";
  25. X11Forwarding = false;
  26. };
  27. };
  28. # System monitoring
  29. smartd = {
  30. enable = true;
  31. autodetect = true;
  32. notifications.mail.enable = true;
  33. notifications.mail.sender = "[email protected]";
  34. notifications.mail.recipient = "I <[email protected]>";
  35. };
  36. nullmailer = {
  37. enable = true;
  38. setSendmail = true;
  39. remotesFile = config.age.secrets."odin/services/nullmailer".path;
  40. config = {
  41. me = "odin.t5.st";
  42. defaulthost = "odin.t5.st";
  43. defaultdomain = "odin.t5.st";
  44. allmailfrom = "[email protected]";
  45. adminaddr = "[email protected]";
  46. };
  47. };
  48. # Drive spin-down management
  49. # hdparm.devices = [
  50. # {
  51. # device = "/dev/disk/by-id/ata-ST8000VN002-2ZM188_WPV023WG";
  52. # spindownTime = 120; # 10 minutes
  53. # apmLevel = 127;
  54. # }
  55. # {
  56. # device = "/dev/disk/by-id/ata-ST8000VN002-2ZM188_WPV07RMA";
  57. # spindownTime = 120;
  58. # apmLevel = 127;
  59. # }
  60. # {
  61. # device = "/dev/disk/by-id/ata-ST8000VN002-2ZM188_WPV020CG";
  62. # spindownTime = 120;
  63. # apmLevel = 127;
  64. # }
  65. # ];
  66. };
  67. # # Container runtime
  68. # virtualisation = {
  69. # docker = {
  70. # enable = true;
  71. # storageDriver = "btrfs";
  72. # autoPrune = {
  73. # enable = true;
  74. # dates = "weekly";
  75. # flags = [ "--all" "--force" "--volumes" ];
  76. # };
  77. # };
  78. # };
  79. programs.fish = {
  80. enable = true;
  81. vendor = {
  82. completions.enable = true;
  83. config.enable = true;
  84. functions.enable = true;
  85. };
  86. };
  87. environment.shells = [
  88. config.programs.fish.package
  89. ];
  90. # System packages
  91. environment.systemPackages = with pkgs; [
  92. # System utilities
  93. git
  94. htop
  95. btop
  96. iotop
  97. powertop
  98. lsof
  99. pciutils
  100. usbutils
  101. # Network tools
  102. curl
  103. wget
  104. rsync
  105. # File system tools
  106. btrfs-progs
  107. xfsprogs
  108. smartmontools
  109. hdparm
  110. # # Container tools
  111. # docker-compose
  112. # Monitoring
  113. lm_sensors
  114. nvme-cli
  115. ];
  116. # System identification
  117. networking.hostName = "odin";
  118. networking.useDHCP = lib.mkDefault true;
  119. # Time synchronization
  120. services.timesyncd.enable = true;
  121. time.timeZone = "Europe/Vienna";
  122. # System state version
  123. system.stateVersion = "25.05";
  124. }