summaryrefslogtreecommitdiffstats
path: root/lass/2configs/IM.nix
blob: 8db2a05d6fb97821d060956b489bd9b3394189d2 (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
35
36
37
38
with (import <stockholm/lib>);
{ config, lib, pkgs, ... }: let
  weechat = pkgs.weechat.override {
    configure = { availablePlugins, ... }: {
      scripts = with pkgs.weechatScripts; [
        weechat-matrix
      ];
    };
  };

  tmux = "/run/current-system/sw/bin/tmux";

in {
  imports = [
    ./bitlbee.nix
  ];
  environment.systemPackages = [ weechat ];
  systemd.services.chat = {
    description = "chat environment setup";
    environment.WEECHAT_HOME = "\$HOME/.weechat";
    after = [ "network.target" ];
    wantedBy = [ "multi-user.target" ];

    restartIfChanged = false;

    path = [
      pkgs.rxvt-unicode-unwrapped.terminfo
    ];

    serviceConfig = {
      User = "lass";
      RemainAfterExit = true;
      Type = "oneshot";
      ExecStart = "${tmux} -2 new-session -d -s IM ${weechat}/bin/weechat";
      ExecStop = "${tmux} kill-session -t IM"; # TODO run save in weechat
    };
  };
}