diff --git a/home-manager/default.nix b/home-manager/default.nix index 697b2e79..3e5d52cc 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -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 diff --git a/home-manager/modules/weechat.nix b/home-manager/modules/weechat.nix new file mode 100644 index 00000000..838c8095 --- /dev/null +++ b/home-manager/modules/weechat.nix @@ -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"; + }; + }; + }; +}; + +}