summary refs log tree commit diff stats
path: root/modules
diff options
context:
space:
mode:
authorAlan Pearce2019-07-26 11:37:13 +0200
committerAlan Pearce2019-07-26 11:37:13 +0200
commitdd4e45818a2a98272851210254e5feacdbdf7c55 (patch)
treef19c73b237d8cff31e8f5e119ebb2ea14da7a006 /modules
parente6e92c12ae75663c4cc45502031056d7b94ea8d5 (diff)
downloadnixos-configuration-dd4e45818a2a98272851210254e5feacdbdf7c55.tar.lz
nixos-configuration-dd4e45818a2a98272851210254e5feacdbdf7c55.tar.zst
nixos-configuration-dd4e45818a2a98272851210254e5feacdbdf7c55.zip
UI: auto-clear old trash items weekly
Diffstat (limited to 'modules')
-rw-r--r--modules/user-interface.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/user-interface.nix b/modules/user-interface.nix
index aaa5e88..a11c4b5 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: