1
0

default.nix 2.7 KB

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