diff options
Diffstat (limited to 'nixops')
-rw-r--r-- | nixops/eldiron.nix | 2 | ||||
-rw-r--r-- | nixops/modules/irc/default.nix | 99 |
2 files changed, 101 insertions, 0 deletions
diff --git a/nixops/eldiron.nix b/nixops/eldiron.nix index 4726d08..5b70eb3 100644 --- a/nixops/eldiron.nix +++ b/nixops/eldiron.nix | |||
@@ -32,6 +32,7 @@ | |||
32 | ./modules/ftp | 32 | ./modules/ftp |
33 | ./modules/pub | 33 | ./modules/pub |
34 | ./modules/task | 34 | ./modules/task |
35 | ./modules/irc | ||
35 | ]; | 36 | ]; |
36 | services.myGitolite.enable = true; | 37 | services.myGitolite.enable = true; |
37 | services.myDatabases.enable = true; | 38 | services.myDatabases.enable = true; |
@@ -39,6 +40,7 @@ | |||
39 | services.myWebsites.integration.enable = true; | 40 | services.myWebsites.integration.enable = true; |
40 | services.myWebsites.tools.enable = true; | 41 | services.myWebsites.tools.enable = true; |
41 | services.pure-ftpd.enable = true; | 42 | services.pure-ftpd.enable = true; |
43 | services.irc.enable = true; | ||
42 | services.pub.enable = true; | 44 | services.pub.enable = true; |
43 | services.myTasks.enable = true; | 45 | services.myTasks.enable = true; |
44 | 46 | ||
diff --git a/nixops/modules/irc/default.nix b/nixops/modules/irc/default.nix new file mode 100644 index 0000000..4cf27e5 --- /dev/null +++ b/nixops/modules/irc/default.nix | |||
@@ -0,0 +1,99 @@ | |||
1 | { lib, pkgs, config, myconfig, mylibs, ... }: | ||
2 | let | ||
3 | bitlbee-mastodon = with pkgs; stdenv.mkDerivation rec { | ||
4 | name = "bitlbee-mastodon-${version}"; | ||
5 | version = "v1.4.2"; | ||
6 | |||
7 | src = fetchFromGitHub { | ||
8 | rev = version; | ||
9 | owner = "kensanata"; | ||
10 | repo = "bitlbee-mastodon"; | ||
11 | sha256 = "04rakgr1pfsg1vhfwlfbggbzw249j7dmk88xrsnf3n84c5ccdyas"; | ||
12 | }; | ||
13 | |||
14 | nativeBuildInputs = [ autoreconfHook pkgconfig ]; | ||
15 | buildInputs = [ bitlbee glib ]; | ||
16 | |||
17 | preConfigure = '' | ||
18 | export BITLBEE_PLUGINDIR=$out/lib/bitlbee | ||
19 | ./autogen.sh | ||
20 | ''; | ||
21 | |||
22 | meta = { | ||
23 | description = "Bitlbee plugin for Mastodon"; | ||
24 | |||
25 | homepage = https://github.com/kensanata/bitlbee-mastodon; | ||
26 | license = lib.licenses.gpl2Plus; | ||
27 | platforms = stdenv.lib.platforms.linux; | ||
28 | }; | ||
29 | }; | ||
30 | bitlbee-discord = pkgs.bitlbee-discord.overrideAttrs(old: rec { | ||
31 | name = "bitlbee-discord-${version}"; | ||
32 | version = "0.4.2"; | ||
33 | |||
34 | src = pkgs.fetchFromGitHub { | ||
35 | rev = version; | ||
36 | owner = "sm00th"; | ||
37 | repo = "bitlbee-discord"; | ||
38 | sha256 = "02pigk2vbz0jdz11f96sygdvp1j762yjn62h124fkcsc070g7a2f"; | ||
39 | }; | ||
40 | }); | ||
41 | bitlbee-facebook = pkgs.bitlbee-facebook.overrideAttrs(old: rec { | ||
42 | name = "bitlbee-facebook-${version}"; | ||
43 | version = "1.2.0"; | ||
44 | |||
45 | src = pkgs.fetchFromGitHub { | ||
46 | rev = "v${version}"; | ||
47 | owner = "bitlbee"; | ||
48 | repo = "bitlbee-facebook"; | ||
49 | sha256 = "11068zhb1v55b1x0nhjc4f3p0glccxpcyk5c1630hfdzkj7vyqhn"; | ||
50 | }; | ||
51 | }); | ||
52 | in | ||
53 | { | ||
54 | options = { | ||
55 | services.irc.enable = lib.mkOption { | ||
56 | type = lib.types.bool; | ||
57 | default = false; | ||
58 | description = '' | ||
59 | Whether to enable irc stuff. | ||
60 | ''; | ||
61 | }; | ||
62 | }; | ||
63 | |||
64 | config = lib.mkIf config.services.irc.enable { | ||
65 | security.acme.certs."irc" = config.services.myCertificates.certConfig // { | ||
66 | domain = "irc.immae.eu"; | ||
67 | postRun = '' | ||
68 | systemctl restart stunnel.service | ||
69 | ''; | ||
70 | }; | ||
71 | |||
72 | networking.firewall.allowedTCPPorts = [ 6697 ]; | ||
73 | services.bitlbee = { | ||
74 | enable = true; | ||
75 | authMode = "Registered"; | ||
76 | libpurple_plugins = [ | ||
77 | pkgs.purple-hangouts | ||
78 | pkgs.purple-matrix | ||
79 | ]; | ||
80 | plugins = [ | ||
81 | bitlbee-mastodon | ||
82 | bitlbee-facebook | ||
83 | bitlbee-discord | ||
84 | pkgs.bitlbee-steam | ||
85 | ]; | ||
86 | }; | ||
87 | |||
88 | services.stunnel = { | ||
89 | enable = true; | ||
90 | servers = { | ||
91 | bitlbee = { | ||
92 | accept = 6697; | ||
93 | connect = 6667; | ||
94 | cert = "/var/lib/acme/irc/full.pem"; | ||
95 | }; | ||
96 | }; | ||
97 | }; | ||
98 | }; | ||
99 | } | ||