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