blob: 37cb53b881429533666894d25ef456ea47951acb (
plain) (
blame)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
{ lib, pkgs, config, myconfig, mylibs, ... }:
let
bitlbee-mastodon = with pkgs; stdenv.mkDerivation rec {
name = "bitlbee-mastodon-${version}";
version = "v1.4.2";
src = fetchFromGitHub {
rev = version;
owner = "kensanata";
repo = "bitlbee-mastodon";
sha256 = "04rakgr1pfsg1vhfwlfbggbzw249j7dmk88xrsnf3n84c5ccdyas";
};
nativeBuildInputs = [ autoreconfHook pkgconfig ];
buildInputs = [ bitlbee glib ];
preConfigure = ''
export BITLBEE_PLUGINDIR=$out/lib/bitlbee
./autogen.sh
'';
meta = {
description = "Bitlbee plugin for Mastodon";
homepage = https://github.com/kensanata/bitlbee-mastodon;
license = lib.licenses.gpl2Plus;
platforms = stdenv.lib.platforms.linux;
};
};
bitlbee-discord = pkgs.bitlbee-discord.overrideAttrs(old: rec {
name = "bitlbee-discord-${version}";
version = "0.4.2";
src = pkgs.fetchFromGitHub {
rev = version;
owner = "sm00th";
repo = "bitlbee-discord";
sha256 = "02pigk2vbz0jdz11f96sygdvp1j762yjn62h124fkcsc070g7a2f";
};
});
bitlbee-facebook = pkgs.bitlbee-facebook.overrideAttrs(old: rec {
name = "bitlbee-facebook-${version}";
version = "1.2.0";
src = pkgs.fetchFromGitHub {
rev = "v${version}";
owner = "bitlbee";
repo = "bitlbee-facebook";
sha256 = "11068zhb1v55b1x0nhjc4f3p0glccxpcyk5c1630hfdzkj7vyqhn";
};
});
in
{
options = {
services.irc.enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to enable irc stuff.
'';
};
};
config = lib.mkIf config.services.irc.enable {
security.acme.certs."irc" = config.services.myCertificates.certConfig // {
domain = "irc.immae.eu";
postRun = ''
systemctl restart stunnel.service
'';
};
nixpkgs.overlays = [ (self: super: rec {
bitlbee = super.bitlbee.overrideAttrs(old: {
patches = (old.patches or []) ++ [ ./bitlbee_long_nicks.patch ];
});
}) ];
networking.firewall.allowedTCPPorts = [ 6697 ];
services.bitlbee = {
enable = true;
authMode = "Registered";
libpurple_plugins = [
pkgs.purple-hangouts
pkgs.purple-matrix
];
plugins = [
bitlbee-mastodon
bitlbee-facebook
bitlbee-discord
pkgs.bitlbee-steam
];
};
services.stunnel = {
enable = true;
servers = {
bitlbee = {
accept = 6697;
connect = 6667;
cert = "/var/lib/acme/irc/full.pem";
};
};
};
};
}
|