From 85cae813e01b83965a9d57be063f3b9cdea9d45e Mon Sep 17 00:00:00 2001
From: matt1432 <matt@nelim.org>
Date: Sat, 15 Feb 2025 13:50:45 -0500
Subject: [PATCH] feat(locate): add timer

---
 modules/base/locate/default.nix | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/base/locate/default.nix b/modules/base/locate/default.nix
index 436e2004..886e75f3 100644
--- a/modules/base/locate/default.nix
+++ b/modules/base/locate/default.nix
@@ -29,7 +29,6 @@ in {
       locateGroup
     ];
 
-    # TODO: add timer
     systemd.services.locate = {
       wantedBy = ["default.target"];
       serviceConfig = {
@@ -41,6 +40,14 @@ in {
       };
     };
 
+    systemd.timers.locate = {
+      wantedBy = ["timers.target"];
+      timerConfig = {
+        Unit = "locate.service";
+        OnCalendar = "*-*-* *:0/10:50"; # Every 10 minutes
+      };
+    };
+
     home-manager.users.${baseCfg.user}.programs.bash.shellAliases = {
       locate = "${pkgs.writeShellScriptBin "lct" ''
         exec ${locate} -d ${database} "$@" 2> >(grep -v "/var/cache/locatedb")