about summary refs log tree commit diff
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2024-02-14 14:26:54 +0100
committerProfpatsch <mail@profpatsch.de>2024-02-14 14:36:28 +0100
commiteca30e7206870ceeabde6aa3087d1db748a84879 (patch)
tree931af1139bdb668c15041f1540c2765dc849228b
parentea4c8740989b7f6fa43435441bca46d7637065dd (diff)
modules/profpatsch/weechat: add stop action
-rw-r--r--modules/user/profpatsch/programs/weechat.nix7
1 files changed, 7 insertions, 0 deletions
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;