From eca30e7206870ceeabde6aa3087d1db748a84879 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Wed, 14 Feb 2024 14:26:54 +0100 Subject: modules/profpatsch/weechat: add stop action --- modules/user/profpatsch/programs/weechat.nix | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'modules') diff --git a/modules/user/profpatsch/programs/weechat.nix b/modules/user/profpatsch/programs/weechat.nix index 5870d078..4fb6c18d 100644 --- a/modules/user/profpatsch/programs/weechat.nix +++ b/modules/user/profpatsch/programs/weechat.nix @@ -58,6 +58,12 @@ let ] ]; + stopWeechatTmuxSession = writeExecline "stop-weechat-tmux-session" {} [ + bins.tmux + "kill-session" + "-t" sessionName + ]; + attachWeechatTmuxSession = writeExecline "attach-weechat-tmux-session" {} [ "importas" "-u" "-D" "" "what" "SSH_ORIGINAL_COMMAND" # if the user passes "ssh" as argv, it will call tmux directly @@ -146,6 +152,7 @@ in environment.WEECHAT_HOME = cfg.weechatDataDir; serviceConfig = { ExecStart = startWeechatTmuxSession cfg.wrapExecStart; + ExecStop = stopWeechatTmuxSession; Restart = "always"; RestartSec = "3s"; User = cfg.userName; -- cgit 1.4.1