summaryrefslogtreecommitdiffstats
path: root/jeschli/2configs/IM.nix
diff options
context:
space:
mode:
authorjeschli <jeschli@gmail.com>2018-01-21 10:40:42 +0000
committerjeschli <jeschli@gmail.com>2018-01-21 10:40:42 +0000
commit7d0c94e36a0e1a90d4fc69de23467b67b01c9bdd (patch)
tree201c9c95b54f59c1434e8afa2df0eeb2d9b780c2 /jeschli/2configs/IM.nix
parentbaf4fc520b9faae6ad07c1b9f6d6623b92768ce6 (diff)
parent3bd62207d4b60db4ca5f89bb84dc842b62bdfbaf (diff)
Merge branch 'master' of prism.i:stockholm
Diffstat (limited to 'jeschli/2configs/IM.nix')
-rw-r--r--jeschli/2configs/IM.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/jeschli/2configs/IM.nix b/jeschli/2configs/IM.nix
new file mode 100644
index 000000000..171b78242
--- /dev/null
+++ b/jeschli/2configs/IM.nix
@@ -0,0 +1,56 @@
+with (import <stockholm/lib>);
+{ config, lib, pkgs, ... }:
+let
+ tmux = pkgs.writeDashBin "tmux" ''
+ export TERM=xterm-256color
+ exec ${pkgs.tmux}/bin/tmux -f ${pkgs.writeText "tmux.conf" ''
+ set-option -g default-terminal screen-256color
+ ''} "$@"
+ '';
+in {
+
+ services.bitlbee = {
+ enable = true;
+ portNumber = 6666;
+ plugins = [
+ pkgs.bitlbee-facebook
+ pkgs.bitlbee-steam
+ pkgs.bitlbee-discord
+ ];
+ libpurple_plugins = [ pkgs.telegram-purple ];
+ };
+
+ users.extraUsers.chat = {
+ home = "/home/chat";
+ uid = genid "chat";
+ useDefaultShell = true;
+ createHome = true;
+ openssh.authorizedKeys.keys = with config.krebs.users; [
+ jeschli.pubkey
+ jeschli-bln.pubkey
+ jeschli-brauerei.pubkey
+ ];
+ packages = [ tmux ];
+ };
+
+
+ systemd.services.chat = {
+ description = "chat environment setup";
+ after = [ "network.target" ];
+ wantedBy = [ "multi-user.target" ];
+
+ restartIfChanged = false;
+
+ path = [
+ pkgs.rxvt_unicode.terminfo
+ ];
+
+ serviceConfig = {
+ User = "chat";
+ RemainAfterExit = true;
+ Type = "oneshot";
+ ExecStart = "${tmux}/bin/tmux -2 new-session -d -s IM ${pkgs.weechat}/bin/weechat";
+ ExecStop = "${tmux}/bin/tmux kill-session -t IM";
+ };
+ };
+}