You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
3.1 KiB

2 months ago
2 months ago
2 months ago
2 months ago
  1. { pkgs, config, inputs, ...}:
  2. {
  3. time.timeZone = "Europe/Berlin";
  4. console.keyMap = "de";
  5. nix.nixPath = [
  6. "nixpkgs=${inputs.nixpkgs}"
  7. ];
  8. users.mutableUsers = false;
  9. users.users."root" = {
  10. hashedPasswordFile = config.sops.secrets."root/password".path;
  11. openssh.authorizedKeys.keys = [
  12. "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK2nkarN0+uSuP5sGwDCb9KRu+FCjO/+da4VypGanPUZ fooker@k-2so"
  13. "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyA8xe6Ej6DpzYSFlyhf3P3QIE1spZAETSa3G/zJ4BjXxO0S4jKsA+Qah6mua2ZIWiRXF6o9JCYsdFKndn1uAzRrHwUk9LCspiI3bsl+EwrBhUbWYnMj2Atp9vMB1SJ6i6RKvDg1YZuvxi4H23MYs3B5a3TBRTlveBxGtZ8Q/YtVDwdW/v1WNAxYe2bz/LFxPNPry6REdGXCuA4cz5s/+ilhRvFQKHbJwC+/SxJIcTY6RAvOFh9wfus2NF0FaEPkwwLLDwxaMOaALwmzGmiBIi/XF3qnSYyPScmEwuq03jmM8qPhJHUHEaxp/cLkjqDWtu+SziEBJ3fu/y/A+vqBS9w== christianpape"
  14. "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCyv3iq+CbKCFCVqQuvSZ4A9fcmCUgm3edS56mfboIEYALrygcoL7gCo5nsrSqvNhUnRE//VCBenIlG+5nUP6vm1H9tg6g+uBVwrJduiueXUOhl/TNRxj6+mB0lg3a9mVGdnbY7lw1xg8pgcuaDKBDM0LyFa0alpsfwnUaVidvHnue0XVd0MRI75KAILg8W1y2vyxxacjlogAJwEFLFUUZm8BSDSGioCw48+HOQvyi9CpkxJeu689yIvFSX2KIDj1YXwK9C1qqcHZnMyvylgkmE+Uz8hWLGcODHP1ZuYJwgEdfTM4zGZAPyFYnFBQ59ccNRTZk8JcfeI6P5M12MfeJaAW4ucutQO77HJgbrfAn8xXgqOcQIboVJ3fM2fUIHZ5i9A1n0R32sJbkWkH9qKW9B+d4SxyHAEvh6m+xwM7GjAPsKtTu9+8JJjVDRnh7PjRGPvoAvc6TArM8Q7fjC9XsNMvc8Cx+opDyJNgOQC13goACDjTqHvvX5wLY5MDKQwN8= gepperth@robolab8"
  15. ];
  16. packages = with pkgs; [
  17. vim
  18. wget
  19. curl
  20. tmux
  21. fd
  22. ripgrep
  23. htop
  24. iotop
  25. iftop
  26. file
  27. ];
  28. };
  29. # system.autoUpgrade = {
  30. # enable = true;
  31. #
  32. # flake = inputs.self.outPath;
  33. # flags = [
  34. # "--update-input" "nixpkgs"
  35. # ];
  36. #
  37. # dates = "02:00";
  38. # randomizedDelaySec = "45min";
  39. # };
  40. services.haveged.enable = true;
  41. services.openssh = {
  42. enable = true;
  43. settings.PermitRootLogin = "without-password";
  44. };
  45. services.snmpd = {
  46. enable = true;
  47. package = pkgs.net-snmp.overrideAttrs (old: {
  48. patches = old.patches ++ [
  49. (pkgs.fetchpatch {
  50. name = "modern-linux-compat.patch";
  51. url = "https://patch-diff.githubusercontent.com/raw/net-snmp/net-snmp/pull/785.patch";
  52. hash = "sha256-ZSF16RacrHddH50inHdmDYnu+fDS5eZd4PgK62s5C4g=";
  53. })
  54. ];
  55. });
  56. configText = ''
  57. rocommunity public 193.174.29.55/32
  58. rocommunity public 127.0.0.1/8
  59. rocommunity6 public ::1/64
  60. com2sec notConfigUser default public
  61. com2sec6 notConfigUser default public
  62. group notConfigGroup v1 notConfigUser
  63. group notConfigGroup v2c notConfigUser
  64. access notConfigGroup "" any noauth exact systemview none none
  65. view systemview included .1.3.6.1.2.1.1
  66. view systemview included .1.3.6.1.2.1.25.1.1
  67. dontLogTCPWrappersConnects yes
  68. '';
  69. };
  70. networking.firewall = {
  71. allowedTCPPorts = [
  72. 22 # SSH
  73. ];
  74. allowedUDPPorts = [
  75. 161 # SNMP
  76. ];
  77. };
  78. sops.secrets."root/password" = {
  79. sopsFile = ./secrets/root.yaml;
  80. neededForUsers = true;
  81. };
  82. }