Skip to content

Instantly share code, notes, and snippets.

@globin
Created October 25, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save globin/99f4fe69f59f1602d6fe to your computer and use it in GitHub Desktop.
Save globin/99f4fe69f59f1602d6fe to your computer and use it in GitHub Desktop.
IM service
{ pkgs, ... }:
{
# 9001 == weechat relay
networking.firewall.allowedTCPPorts = [ 9001 ];
systemd.services.comm = {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
Type = "forking";
User = "robin";
ExecStart = ''${pkgs.tmux}/bin/tmux new-session -P -d -s comm'';
ExecStop = ''${pkgs.tmux}/bin/tmux kill-session -t comm'';
};
postStart = ''${pkgs.tmux}/bin/tmux new-window -P -n irc -t comm:0 -k ${pkgs.weechat}/bin/weechat; ${pkgs.tmux}/bin/tmux new-window -P -n xmpp -t comm:1 ${pkgs.poezio}/bin/poezio'';
};
environment.etc."ssl/private/weechat-relay.pem" = {
source = ../ssl/weechat-relay.pem;
uid = 1000;
mode = "0400";
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment