-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy paththelounge.nix
57 lines (55 loc) · 1.63 KB
/
thelounge.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
46
47
48
49
50
51
52
53
54
55
56
57
{ pkgs, config, ... }:
let
identityFile = "/var/secrets/id_ed25519";
ldapAccount = import /var/secrets/thelounge.nix;
identPort = 1113;
oidentdConfig = pkgs.writeText "oident.conf" ''
user "thelounge" {
default {
allow spoof
allow spoof_all
force forward 127.0.0.1 ${builtins.toString identPort}
}
}
'';
in {
services.thelounge = {
enable = true;
port = 16667;
extraConfig = {
leaveMessage = "Bye for now";
lockNetwork = true;
defaults = {
name = "Redbrick";
host = "irc.redbrick.dcu.ie";
port = 6697;
tls = true;
password = "";
join = "#lobby,#intersocs,#bots,#helpdesk";
};
identd = {
enable = true;
port = identPort;
};
ldap = {
enable = true;
url = config.users.ldap.server;
primaryKey = "uid";
searchDN = {
base = config.users.ldap.base;
filter = "(objectClass=posixAccount)";
rootDN = ldapAccount.dn;
rootPassword = ldapAccount.password;
};
};
};
};
systemd.services.oidentd = {
description = "identd server, routing requests to TheLounge";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${pkgs.oidentd}/bin/oidentd -c ${oidentdConfig} -i -S";
};
};
networking.firewall.allowedTCPPorts = [ 113 ];
}