1
0

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. ./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. 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. # User configuration
  117. users.mutableUsers = false;
  118. users.users.thomas = {
  119. isNormalUser = true;
  120. extraGroups = [ "wheel" "users" ];
  121. shell = config.programs.fish.package;
  122. hashedPasswordFile = config.age.secrets."odin/users/thomas".path;
  123. openssh.authorizedKeys.keys = [
  124. "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC5o7LT5wPYWgI8Mvr6RKOv+BcsbQgU7PCw2hheVu17alwF1uFUsAYV5BVQu+uv9uEm/UDsCNhfM6TwI0A1prdmtBz4pKiwXbj7fcdp6DcVOgTsPfawbXEpivtJvlhEatyTsR26MjHKnqpT0BxPvj6Ug6pvRkCYW5d2bWXiY9murmAX6Q5kSyNunkB8PdRTH+S47f7eOdCJY63VBOkkiG8M7XyPwFCDTYiHhbMZcejIdY9mB6kYnMQVRHDznQWiQxrcaE1fD/TY3db9GDcOVoo2aDBOZX7WT2+me67sU8dEK9+nSyhWDzBbEs8knu87ZlKPFwhl4slenRniKhbf22OpicXArtEcjEj0GyDJH5e+ZCIQ4eSQanA7TxnKFlDuaf+Qqx55UT+ya4vJJeik7nkzbRHaE9IoWhhiOaOnaN6kHIxuxB6z7EL3Gk7f78+I/qBaj5df6fgnXM3JBXKa5bRH2wqoSetJAo6EGpEgmU2huB1ktiGlO7BlF5XwSw6cb/KT7NSIXhncgLkCzsDVXxecVQv1FnPISBcp3+ti01ADVf2trgpPDbNTWV40Rgiefie0o2fc6KWAFfum1j5N3WWU+XVVmRjDmKKHiEJBLNKDAe0rQf+tryPW4c5GIN7aFoB+8dYFAuUyLd7Fu3vhZdmcckN5ryHunEc0dKPIiuoVZw=="
  125. ];
  126. };
  127. # System identification
  128. networking.hostName = "odin";
  129. networking.useDHCP = lib.mkDefault true;
  130. # Time synchronization
  131. services.timesyncd.enable = true;
  132. time.timeZone = "Europe/Vienna";
  133. # System state version
  134. system.stateVersion = "25.05";
  135. }