my Nix configuration
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.

quassel.nix 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {config, pkgs, lib, ...}:
  2. {
  3. options.services.yorick.quassel = {
  4. enable = lib.mkEnableOption "quassel container";
  5. };
  6. config = lib.mkIf config.services.yorick.quassel.enable {
  7. containers.quassel = {
  8. config = { config, pkgs, ... }: {
  9. services.postgresql = {
  10. enable = true;
  11. package = pkgs.postgresql94;
  12. extraConfig = ''
  13. max_connections = 10
  14. shared_buffers = 1GB
  15. effective_cache_size = 4GB
  16. work_mem = 50MB
  17. maintenance_work_mem = 100MB
  18. '';
  19. };
  20. services.quassel = {
  21. # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/networking/quassel.nix
  22. enable = true;
  23. interfaces = ["0.0.0.0"];
  24. };
  25. environment.systemPackages = [
  26. pkgs.quasselDaemon
  27. ];
  28. networking.firewall.allowedTCPPorts = [4242];
  29. };
  30. privateNetwork = true;
  31. hostAddress = "192.168.125.1";
  32. localAddress = "192.168.125.11";
  33. };
  34. # give the containers networking
  35. networking.nat = {
  36. enable = true;
  37. internalInterfaces = ["ve-+"];
  38. externalInterface = "enp2s0";
  39. forwardPorts = [
  40. { sourcePort = 4242; destination = "192.168.125.11:4242"; }
  41. ];
  42. };
  43. networking.firewall.allowedTCPPorts = [4242];
  44. };
  45. }