From dd4e45818a2a98272851210254e5feacdbdf7c55 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 26 Jul 2019 11:37:13 +0200 Subject: UI: auto-clear old trash items weekly --- modules/user-interface.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'modules') diff --git a/modules/user-interface.nix b/modules/user-interface.nix index aaa5e88d..a11c4b59 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -86,6 +86,23 @@ in }; }; + systemd.user.services.trash-clean = { + path = with pkgs; [ trash-cli ]; + description = "Remove old files from FreeDesktop.org trash"; + + serviceConfig = { + Type = "oneshot"; + }; + script = "trash-empty 30"; + }; + systemd.user.timers.trash-clean = { + wantedBy = [ "default.target" ]; + timerConfig = { + OnCalendar = "weekly"; + Persistent = true; + }; + }; + environment.variables = { # This is required so that GTK applications launched from Emacs # get properly themed: -- cgit 1.4.1