1
0

default.nix 3.8 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.test = true;
  31. notifications.mail.enable = true;
  32. notifications.mail.sender = "[email protected]";
  33. notifications.mail.recipient = "I <[email protected]>";
  34. };
  35. nullmailer = {
  36. enable = true;
  37. setSendmail = true;
  38. remotesFile = config.age.secrets."odin/nullmailer/remotes".path;
  39. config = {
  40. me = "odin.t5.st";
  41. defaulthost = "odin.t5.st";
  42. defaultdomain = "odin.t5.st";
  43. allmailfrom = "[email protected]";
  44. adminaddr = "[email protected]";
  45. };
  46. };
  47. # Drive spin-down management
  48. # hdparm.devices = [
  49. # {
  50. # device = "/dev/disk/by-id/ata-ST8000VN002-2ZM188_WPV023WG";
  51. # spindownTime = 120; # 10 minutes
  52. # apmLevel = 127;
  53. # }
  54. # {
  55. # device = "/dev/disk/by-id/ata-ST8000VN002-2ZM188_WPV07RMA";
  56. # spindownTime = 120;
  57. # apmLevel = 127;
  58. # }
  59. # {
  60. # device = "/dev/disk/by-id/ata-ST8000VN002-2ZM188_WPV020CG";
  61. # spindownTime = 120;
  62. # apmLevel = 127;
  63. # }
  64. # ];
  65. };
  66. # # Container runtime
  67. # virtualisation = {
  68. # docker = {
  69. # enable = true;
  70. # storageDriver = "btrfs";
  71. # autoPrune = {
  72. # enable = true;
  73. # dates = "weekly";
  74. # flags = [ "--all" "--force" "--volumes" ];
  75. # };
  76. # };
  77. # };
  78. programs.fish = {
  79. enable = true;
  80. vendor = {
  81. completions.enable = true;
  82. config.enable = true;
  83. functions.enable = true;
  84. };
  85. };
  86. environment.shells = [
  87. config.programs.fish.package
  88. ];
  89. # System packages
  90. environment.systemPackages = with pkgs; [
  91. # System utilities
  92. htop
  93. btop
  94. iotop
  95. lsof
  96. pciutils
  97. usbutils
  98. # Network tools
  99. curl
  100. wget
  101. rsync
  102. # File system tools
  103. btrfs-progs
  104. xfsprogs
  105. smartmontools
  106. hdparm
  107. # # Container tools
  108. # docker-compose
  109. # Storage management
  110. snapraid
  111. mergerfs
  112. # Monitoring
  113. lm_sensors
  114. nvme-cli
  115. ];
  116. # User configuration
  117. users.mutableUsers = false;
  118. users.users.thomas = {
  119. isNormalUser = true;
  120. extraGroups = [ "wheel" "users" ];
  121. hashedPasswordFile = config.age.secrets."odin/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. }