2021-01-23 17:32:56 +00:00
|
|
|
with (import <stockholm/lib>);
|
2021-07-05 15:52:27 +00:00
|
|
|
{ config, lib, pkgs, ... }: let
|
|
|
|
weechat = pkgs.weechat.override {
|
2022-05-29 17:42:22 +00:00
|
|
|
configure = { availablePlugins, ... }: {
|
|
|
|
scripts = with pkgs.weechatScripts; [
|
|
|
|
weechat-matrix
|
|
|
|
];
|
2021-07-05 15:52:27 +00:00
|
|
|
};
|
|
|
|
};
|
2021-01-23 17:32:56 +00:00
|
|
|
|
2022-05-29 17:42:22 +00:00
|
|
|
tmux = "/run/current-system/sw/bin/tmux";
|
2021-01-23 17:32:56 +00:00
|
|
|
|
2021-07-05 15:52:27 +00:00
|
|
|
in {
|
|
|
|
imports = [
|
|
|
|
./bitlbee.nix
|
|
|
|
];
|
2022-05-29 17:42:22 +00:00
|
|
|
environment.systemPackages = [ weechat ];
|
2021-07-05 15:52:27 +00:00
|
|
|
systemd.services.chat = {
|
2021-01-23 17:32:56 +00:00
|
|
|
description = "chat environment setup";
|
2022-05-29 17:42:22 +00:00
|
|
|
environment.WEECHAT_HOME = "\$HOME/.weechat";
|
2021-01-23 17:32:56 +00:00
|
|
|
after = [ "network.target" ];
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
|
|
|
restartIfChanged = false;
|
|
|
|
|
|
|
|
path = [
|
|
|
|
pkgs.rxvt_unicode.terminfo
|
|
|
|
];
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
User = "lass";
|
|
|
|
RemainAfterExit = true;
|
|
|
|
Type = "oneshot";
|
2022-05-29 17:42:22 +00:00
|
|
|
ExecStart = "${tmux} -2 new-session -d -s IM ${weechat}/bin/weechat";
|
|
|
|
ExecStop = "${tmux} kill-session -t IM"; # TODO run save in weechat
|
2021-01-23 17:32:56 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|