default.nix 3.9 KB

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