-
-
Save tilpner/3da009df9bd66dd0aff6a662f5dcb432 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, mod, ... }: | |
let | |
inherit (pkgs) abduco weechat; | |
in { | |
users.users.weechat = { | |
isSystemUser = true; | |
home = "/var/lib/weechat"; | |
createHome = true; | |
openssh.authorizedKeys.keyFiles = [ | |
(mod /assets/somehostname.pub) | |
]; | |
packages = [ abduco ]; | |
files.".profile".text = '' | |
if [ -n "$SSH_TTY" ]; then | |
exec abduco -a irc | |
fi | |
''; | |
shell = pkgs.bashInteractive; | |
}; | |
services.nginx.virtualHosts."weechat.my.domain" = { | |
forceSSL = true; | |
enableACME = true; | |
locations."/weechat" = { | |
proxyPass = "http://127.0.0.1:9000/weechat"; | |
extraConfig = '' | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "Upgrade"; | |
''; | |
}; | |
}; | |
systemd.services.weechat = { | |
path = with pkgs; [ abduco weechat ]; | |
script = '' | |
abduco -n irc weechat -d ${config.users.users.weechat.home} | |
''; | |
environment = { | |
TERM = "st-256color"; | |
NCURSES_NO_UTF8_ACS = "1"; | |
}; | |
serviceConfig = { | |
Type = "forking"; | |
User = "weechat"; | |
WorkingDirectory = config.users.users.weechat.home; | |
Restart = "always"; | |
RestartSec = 3; | |
}; | |
wantedBy = [ "multi-user.target" ]; | |
wants = [ "network-online.target" ]; | |
after = [ "network-online.target" ]; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment