1
0
Fork 0

Add weechat

This commit is contained in:
Malte Brandy 2018-06-05 22:20:22 +02:00
parent 2a3f5574cf
commit 393ad37da8
2 changed files with 47 additions and 0 deletions

View file

@ -18,6 +18,7 @@ imports = [
./modules/home-options.nix
./modules/eventd.nix
./modules/unlock.nix
./modules/weechat.nix
../common/private-options.nix
../common/secret
# ./sort-mail.nix

View file

@ -0,0 +1,46 @@
{ lib, pkgs, config, ... }:
with lib;
let
in {
options.m-0.weechat = {
enable = mkEnableOption "Weechat";
channels = mkOption {
type = types.listOf types.str;
default = [];
};
user = mkOption {
type = types.str;
};
pw = mkOption {
type = types.str;
};
};
config = mkIf config.m-0.weechat.enable {
systemd.user.services = {
weechat = {
Unit = {
Description = "Weechat IRC Client (in tmux)";
};
Service = {
ExecStart = "${pkgs.tmux}/bin/tmux -L weechat -2 new-window -kt irc:0 '${pkgs.weechat}/bin/weechat'";
ExecStop = "${pkgs.tmux}/bin/tmux -L weechat kill-window -t irc:0";
};
Install = {
WantedBy = [ "default.target" ];
};
};
weechat-tmux = {
Unit = {
Description = "Weechat Tmux Session";
};
Service = {
ExecStart = "${pkgs.tmux}/bin/tmux -L weechat -2 new-window -d -s irc -n 'bash' '${pkgs.zsh}/bin/zsh'";
ExecStop = "${pkgs.tmux}/bin/tmux -L weechat kill-window -t irc";
};
};
};
};
}