default.nix 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. ./mergerfs.nix
  12. ./system.nix
  13. ./services
  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. htop
  94. btop
  95. iotop
  96. lsof
  97. pciutils
  98. usbutils
  99. # Network tools
  100. curl
  101. wget
  102. rsync
  103. # File system tools
  104. btrfs-progs
  105. xfsprogs
  106. smartmontools
  107. hdparm
  108. # # Container tools
  109. # docker-compose
  110. # Storage management
  111. snapraid
  112. mergerfs
  113. # Monitoring
  114. lm_sensors
  115. nvme-cli
  116. ];
  117. # User configuration
  118. users.mutableUsers = false;
  119. users.users.thomas = {
  120. isNormalUser = true;
  121. extraGroups = [ "wheel" "users" ];
  122. shell = config.programs.fish.package;
  123. hashedPasswordFile = config.age.secrets."odin/users/thomas".path;
  124. openssh.authorizedKeys.keys = [
  125. "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC5o7LT5wPYWgI8Mvr6RKOv+BcsbQgU7PCw2hheVu17alwF1uFUsAYV5BVQu+uv9uEm/UDsCNhfM6TwI0A1prdmtBz4pKiwXbj7fcdp6DcVOgTsPfawbXEpivtJvlhEatyTsR26MjHKnqpT0BxPvj6Ug6pvRkCYW5d2bWXiY9murmAX6Q5kSyNunkB8PdRTH+S47f7eOdCJY63VBOkkiG8M7XyPwFCDTYiHhbMZcejIdY9mB6kYnMQVRHDznQWiQxrcaE1fD/TY3db9GDcOVoo2aDBOZX7WT2+me67sU8dEK9+nSyhWDzBbEs8knu87ZlKPFwhl4slenRniKhbf22OpicXArtEcjEj0GyDJH5e+ZCIQ4eSQanA7TxnKFlDuaf+Qqx55UT+ya4vJJeik7nkzbRHaE9IoWhhiOaOnaN6kHIxuxB6z7EL3Gk7f78+I/qBaj5df6fgnXM3JBXKa5bRH2wqoSetJAo6EGpEgmU2huB1ktiGlO7BlF5XwSw6cb/KT7NSIXhncgLkCzsDVXxecVQv1FnPISBcp3+ti01ADVf2trgpPDbNTWV40Rgiefie0o2fc6KWAFfum1j5N3WWU+XVVmRjDmKKHiEJBLNKDAe0rQf+tryPW4c5GIN7aFoB+8dYFAuUyLd7Fu3vhZdmcckN5ryHunEc0dKPIiuoVZw=="
  126. ];
  127. };
  128. # System identification
  129. networking.hostName = "odin";
  130. networking.useDHCP = lib.mkDefault true;
  131. # Time synchronization
  132. services.timesyncd.enable = true;
  133. time.timeZone = "Europe/Vienna";
  134. # System state version
  135. system.stateVersion = "25.05";
  136. }