From 32673e15e2d339e3d1e44584cef121acca05013f Mon Sep 17 00:00:00 2001 From: Aubrey Taylor Date: Sun, 26 Jan 2025 13:28:27 -0600 Subject: [PATCH] flake+++ --- flake.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 57dfb71..deacf49 100644 --- a/flake.nix +++ b/flake.nix @@ -62,15 +62,18 @@ }; }; config = lib.mkIf config.services.wanireminder.enable { - systemd.services.wanireminder = { - wantedBy = ["multi-user.target"]; + systemd.timers.wanireminder = { + wantedBy = ["wanireminder.target"]; after = ["network.target"]; - description = "Run wanireminders"; - serviceConfig = { - WorkingDirectory = "${self.defaultPackage.${system}}"; - Type = "oneshot"; + timerConfig = { OnCalendar = "hourly"; Persistent = true; + }; + }; + systemd.services.wanireminder = { + description = "Run wanireminders"; + serviceConfig = { + Type = "oneshot"; ExecStart = let configJson = builtins.toFile "config.json" (builtins.toJSON config.services.wanireminder); in ''${self.defaultPackage.${system}}/bin/wanireminder ${configJson}'';