1
0

default.nix 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. { config
  2. , lib
  3. , pkgs
  4. , outputs
  5. , ...
  6. }:
  7. {
  8. imports = [
  9. # TODO: auto-import via `outputs.modules.nixos`
  10. outputs.modules.global.nix-config
  11. ./system
  12. ./services
  13. ./users
  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. nullmailer = {
  29. enable = true;
  30. setSendmail = true;
  31. remotesFile = config.age.secrets."odin/services/nullmailer".path;
  32. config = {
  33. me = "odin.t5.st";
  34. defaulthost = "odin.t5.st";
  35. defaultdomain = "odin.t5.st";
  36. allmailfrom = "[email protected]";
  37. adminaddr = "[email protected]";
  38. };
  39. };
  40. };
  41. # # Container runtime
  42. # virtualisation = {
  43. # docker = {
  44. # enable = true;
  45. # storageDriver = "btrfs";
  46. # autoPrune = {
  47. # enable = true;
  48. # dates = "weekly";
  49. # flags = [ "--all" "--force" "--volumes" ];
  50. # };
  51. # };
  52. # };
  53. containers.grist-latest = {
  54. autoStart = false;
  55. privateNetwork = true;
  56. hostAddress = "192.168.1.1";
  57. localAddress = "192.168.1.2";
  58. specialArgs = { inherit outputs; };
  59. config = import ./containers/grist.nix;
  60. };
  61. services.caddy.virtualHosts.grist = {
  62. hostName = "grist.{$DOMAIN}";
  63. extraConfig = ''
  64. encode gzip zstd
  65. reverse_proxy 192.168.1.2:8484
  66. '';
  67. };
  68. programs.fish = {
  69. enable = true;
  70. vendor = {
  71. completions.enable = true;
  72. config.enable = true;
  73. functions.enable = true;
  74. };
  75. };
  76. environment.shells = [
  77. config.programs.fish.package
  78. ];
  79. # System packages
  80. # nixos-container create grist --flake .#grist --host-address "192.168.1.1" --local-address
  81. environment.systemPackages = with pkgs; [
  82. # System utilities
  83. git
  84. htop
  85. btop
  86. iotop
  87. powertop
  88. lsof
  89. pciutils
  90. usbutils
  91. # Network tools
  92. curl
  93. wget
  94. rsync
  95. # File system tools
  96. btrfs-progs
  97. xfsprogs
  98. smartmontools
  99. hdparm
  100. # # Container tools
  101. # docker-compose
  102. # Monitoring
  103. lm_sensors
  104. nvme-cli
  105. ];
  106. # System identification
  107. networking.hostName = "odin";
  108. networking.useDHCP = lib.mkDefault true;
  109. # Time synchronization
  110. services.timesyncd.enable = true;
  111. time.timeZone = "Europe/Vienna";
  112. # System state version
  113. system.stateVersion = "25.05";
  114. }