summaryrefslogtreecommitdiffstats
path: root/lass/2configs/bitlbee.nix
blob: 43573d8933caa4eebeff7370e0eb3dbf41bdf5d2 (plain)
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
with (import <stockholm/lib>);
{ config, lib, pkgs, ... }:

{
  services.bitlbee = {
    enable = true;
    portNumber = 6666;
    plugins = [
      pkgs.bitlbee-facebook
      pkgs.bitlbee-steam
      pkgs.bitlbee-discord
    ];
    libpurple_plugins = [
      # pkgs.telegram-purple
      # pkgs.tdlib-purple
      # pkgs.purple-gowhatsapp
    ];
    configDir = "/var/state/bitlbee";
  };

  systemd.services.bitlbee.serviceConfig = {
    ExecStartPre = [
      "+${pkgs.writeDash "setup-bitlbee" ''
        ${pkgs.coreutils}/bin/chown bitlbee:bitlbee /var/state/bitlbee || :
      ''}"
    ];
    ReadWritePaths = [
      "/var/state/bitlbee"
    ];
  };
  systemd.tmpfiles.rules = [
    "d /var/state/bitlbee 0700 - - -"
  ];
}