1
0
Fork 0
nixos-config/home-manager/roles/weechat/default.nix

112 lines
2.9 KiB
Nix
Raw Normal View History

2022-03-08 01:42:46 +00:00
{
lib,
pkgs,
config,
...
}:
with lib; let
2020-04-26 13:29:23 +00:00
weechat = pkgs.wrapWeechat pkgs.weechat-unwrapped {
2022-03-08 01:42:46 +00:00
configure = {availablePlugins, ...}: {
plugins = builtins.attrValues (availablePlugins
// {
2022-03-08 02:19:09 +00:00
python = availablePlugins.python.withPackages
2022-03-08 04:53:07 +00:00
(_: [pkgs.weechatScripts.weechat-matrix]);
2020-01-13 19:34:48 +00:00
});
2022-03-08 01:42:46 +00:00
scripts = [pkgs.weechatScripts.weechat-matrix];
2020-01-13 19:34:48 +00:00
};
};
2022-03-08 01:42:46 +00:00
in {
2020-01-13 19:34:48 +00:00
home.file = {
python_plugins = {
target = ".weechat/python";
source = ./plugins/python;
};
perl_plugins = {
target = ".weechat/perl";
source = ./plugins/perl;
};
buflist = {
target = ".weechat/buflist.conf";
text = ''
[look]
enabled = off
'';
};
weechat = {
target = ".weechat/weechat.conf";
text = ''
[look]
buffer_notify_default = "highlight"
jump_current_to_previous_buffer = off
2021-11-09 17:02:34 +00:00
highlight_words = ""
highlight_regex = ".*maralorn([^\.].*|\.|\.[^d].*|)$"
2020-01-13 19:34:48 +00:00
[key]
meta-g = "/go"
${builtins.readFile ./default-keys.conf}
[color]
chat_nick_colors = "cyan,magenta,green,brown,lightblue,default,lightcyan,lightmagenta,lightgreen,blue,31,35,38,40,49,63,70,80,92,99,112,126,130,138,142,148,160,162,167,169,174,176,178,184,186,210,212,215,228"
2020-04-11 23:46:06 +00:00
chat_highlight = "black"
chat_highlight_bg = "lightblue"
2020-01-13 19:34:48 +00:00
'';
};
logger = {
target = ".weechat/logger.conf";
text = ''
[look]
backlog = 10000
[mask]
python = "%Y/matrix:$server/$channel/%Y-%m-%d-$name.weechatlog"
[file]
mask = "%Y/$name/%Y-%m-%d.weechatlog"
path = "${config.home.homeDirectory}/logs/"
'';
};
matrix = {
target = ".weechat/matrix.conf";
text = ''
[look]
human_buffer_names = on
[server]
2022-03-08 01:42:46 +00:00
${
lib.concatStringsSep "\n" (lib.mapAttrsToList
2020-01-13 19:34:48 +00:00
(server: serverConfig: ''
${server}.address = "${serverConfig.address}"
${server}.autoconnect = on
${server}.username = "${serverConfig.user}"
${server}.password = "${serverConfig.password}"
2022-03-08 01:42:46 +00:00
'') (pkgs.privateValue {} "weechat/matrix"))
}
2020-01-13 19:34:48 +00:00
'';
};
};
2020-01-21 13:31:48 +00:00
systemd.user = {
2020-12-13 20:16:46 +00:00
timers.log2rss = {
2020-12-09 20:11:07 +00:00
Timer.OnCalendar = "19:55";
2022-03-08 01:42:46 +00:00
Install.WantedBy = ["timers.target"];
2020-01-21 13:31:48 +00:00
};
services = {
2020-12-13 20:16:46 +00:00
log2rss = {
Unit.Description = "log2rss";
2020-01-21 13:31:48 +00:00
Service = {
2022-03-08 01:42:46 +00:00
ExecStart = "${pkgs.logfeed}/bin/log2rss /var/www/rss/chats.xml";
2020-01-21 13:31:48 +00:00
Type = "oneshot";
};
};
weechat = {
2020-12-09 20:11:07 +00:00
Unit.Description = "Weechat Tmux Session";
2020-01-21 13:31:48 +00:00
Service = {
Type = "forking";
2022-03-08 01:42:46 +00:00
ExecStart = "${pkgs.tmux}/bin/tmux -L weechat -2 new-session -d -s irc -n weechat '${weechat}/bin/weechat'";
2020-01-21 13:31:48 +00:00
Restart = "always";
};
2022-03-08 01:42:46 +00:00
Install.WantedBy = ["default.target"];
2020-01-13 19:34:48 +00:00
};
};
};
}