From 202375815ff8f0de7550cb03212d56b858dcfd90 Mon Sep 17 00:00:00 2001 From: Tigor Hutasuhut Date: Mon, 4 Nov 2024 21:44:42 +0700 Subject: [PATCH] zellij: added systemd unit to cleanup killed sessions every day at 4:00 --- home/programs/zellij/default.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/home/programs/zellij/default.nix b/home/programs/zellij/default.nix index b1c0090..b4cc29e 100644 --- a/home/programs/zellij/default.nix +++ b/home/programs/zellij/default.nix @@ -23,6 +23,27 @@ in programs.zellij.enable = true; programs.zellij.package = unstable.zellij; + systemd.user = { + services.zellij-cleanup = { + Service = { + Description = "Zellij cleanup killed sessions"; + ExecStart = "${unstable.zellij}/bin/zellij delete-all-sessions --yes"; + }; + }; + timers.zellij-cleanup = { + Unit = { + Description = "Zellij cleanup killed sessions"; + }; + Timer = { + OnCalendar = "*-*-* 4:00:00"; + Persistent = true; + }; + Install = { + WantedBy = [ "timers.target" ]; + }; + }; + }; + # Uses initExtraFirst instead of initExtra # to avoid loading of zsh plugins before zellij loads. #