mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
fix(weechat): move bouncer from toum to makanek and make stateless
This commit is contained in:
@@ -124,7 +124,7 @@ in {
|
|||||||
zathura = swallow "${pkgs.zathura}/bin/zathura";
|
zathura = swallow "${pkgs.zathura}/bin/zathura";
|
||||||
us = "${pkgs.systemd}/bin/systemctl --user";
|
us = "${pkgs.systemd}/bin/systemctl --user";
|
||||||
wcd = "source ${wcd}";
|
wcd = "source ${wcd}";
|
||||||
weechat = "${pkgs.openssh}/bin/ssh weechat@toum -t screen -x weechat-screen";
|
im = "${pkgs.openssh}/bin/ssh weechat@makanek -t tmux attach-session -t IM";
|
||||||
where = "source ${where}";
|
where = "source ${where}";
|
||||||
yt =
|
yt =
|
||||||
"${pkgs.youtube-dl}/bin/youtube-dl --add-metadata -ic"; # Download video link
|
"${pkgs.youtube-dl}/bin/youtube-dl --add-metadata -ic"; # Download video link
|
||||||
|
|||||||
71
configs/weechat.nix
Normal file
71
configs/weechat.nix
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
let inherit (import <niveum/lib>) kieran;
|
||||||
|
in {
|
||||||
|
systemd.services.weechat =
|
||||||
|
let
|
||||||
|
tmux = pkgs.writers.writeDash "tmux" ''
|
||||||
|
exec ${pkgs.tmux}/bin/tmux -f ${pkgs.writeText "tmux.conf" ''
|
||||||
|
set-option -g prefix `
|
||||||
|
unbind-key C-b
|
||||||
|
bind ` send-prefix
|
||||||
|
|
||||||
|
set-option -g status off
|
||||||
|
set-option -g default-terminal screen-256color
|
||||||
|
|
||||||
|
#use session instead of windows
|
||||||
|
bind-key c new-session
|
||||||
|
bind-key p switch-client -p
|
||||||
|
bind-key n switch-client -n
|
||||||
|
bind-key C-s switch-client -l
|
||||||
|
''} "$@"
|
||||||
|
'';
|
||||||
|
weechat = pkgs.weechat.override {
|
||||||
|
configure = { ... }: {
|
||||||
|
init = ''
|
||||||
|
/set irc.server_default.nicks "kmein,kfm,kieran"
|
||||||
|
/set irc.server_default.msg_part "tschö mit ö"
|
||||||
|
/set irc.server_default.msg_quit "ciao kakao"
|
||||||
|
/set irc.server_default.msg_kick "warum machst du diese?"
|
||||||
|
/set irc.server_default.realname "${kieran.name}"
|
||||||
|
/server add freenode chat.freenode.org
|
||||||
|
/server add irc.r irc.r
|
||||||
|
/server add news.r news.r
|
||||||
|
/alias add mod /quote omode $channel +o $nick
|
||||||
|
/set irc.server.freenode.autojoin "#krebs,##myengadin"
|
||||||
|
/set irc.server.irc.r.autojoin "#xxx,#brockman"
|
||||||
|
/set irc.server.news.r.autojoin "#drachengame,#memes,#all,#berlin"
|
||||||
|
/set logger.level.irc.news.r.#all 0
|
||||||
|
/filter addreplace corona irc.news.r.* * corona|covid|virus|lockdown|va[kc][sc]in|mutante|mutation|impf|pandemi
|
||||||
|
/connect freenode
|
||||||
|
/connect irc.r
|
||||||
|
/connect news.r
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
description = "Weechat bouncer";
|
||||||
|
after = [ "network.target" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
restartIfChanged = false;
|
||||||
|
path = [ pkgs.alacritty.terminfo ];
|
||||||
|
environment.WEECHAT_HOME = "/var/lib/weechat";
|
||||||
|
script = "${tmux} -2 new-session -d -s IM ${weechat}/bin/weechat";
|
||||||
|
preStop = "${tmux} kill-session -t IM";
|
||||||
|
serviceConfig = {
|
||||||
|
User = "weechat";
|
||||||
|
RemainAfterExit = true;
|
||||||
|
Type = "oneshot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups.weechat = {};
|
||||||
|
users.extraUsers.weechat = {
|
||||||
|
useDefaultShell = true;
|
||||||
|
openssh.authorizedKeys.keys = kieran.sshKeys pkgs;
|
||||||
|
createHome = true;
|
||||||
|
group = "weechat";
|
||||||
|
home = "/var/lib/weechat";
|
||||||
|
isSystemUser = true;
|
||||||
|
packages = [ pkgs.tmux ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -15,6 +15,7 @@ in
|
|||||||
<niveum/configs/urlwatch.nix>
|
<niveum/configs/urlwatch.nix>
|
||||||
<niveum/configs/gitea.nix>
|
<niveum/configs/gitea.nix>
|
||||||
<niveum/configs/telegram-bots>
|
<niveum/configs/telegram-bots>
|
||||||
|
<niveum/configs/weechat.nix>
|
||||||
<niveum/configs/matterbridge.nix>
|
<niveum/configs/matterbridge.nix>
|
||||||
<niveum/modules/retiolum.nix>
|
<niveum/modules/retiolum.nix>
|
||||||
];
|
];
|
||||||
@@ -63,5 +64,5 @@ in
|
|||||||
email = kieran.email;
|
email = kieran.email;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.vim pkgs.git ];
|
environment.systemPackages = [ pkgs.vim pkgs.git pkgs.tmux ];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,13 +15,6 @@ in {
|
|||||||
<niveum/configs/version.nix>
|
<niveum/configs/version.nix>
|
||||||
<niveum/configs/traadfri.nix>
|
<niveum/configs/traadfri.nix>
|
||||||
<niveum/modules/retiolum.nix>
|
<niveum/modules/retiolum.nix>
|
||||||
{
|
|
||||||
services.weechat.enable = true;
|
|
||||||
users.extraUsers.weechat = {
|
|
||||||
useDefaultShell = true;
|
|
||||||
openssh.authorizedKeys.keys = kieran.sshKeys pkgs;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
nix.nixPath = [ "/var/src" ];
|
nix.nixPath = [ "/var/src" ];
|
||||||
|
|||||||
Reference in New Issue
Block a user