From 44fc5f979248e6db7b8c8a7a2f0b739f43c8cd1b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= <motiejus@jakstys.lt>
Date: Sun, 30 Mar 2025 19:26:48 +0000
Subject: [PATCH] some testing

---
 hosts/mtworx/configuration.nix             | 20 ++++++++++++++++++++
 modules/services/timelapse-r11/default.nix |  2 +-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/hosts/mtworx/configuration.nix b/hosts/mtworx/configuration.nix
index 0596dae..8215b9a 100644
--- a/hosts/mtworx/configuration.nix
+++ b/hosts/mtworx/configuration.nix
@@ -1,4 +1,5 @@
 {
+  lib,
   config,
   pkgs,
   myData,
@@ -6,6 +7,13 @@
 }:
 let
   nvme = "/dev/disk/by-id/nvme-WD_PC_SN810_SDCQNRY-1T00-1201_23234W800017";
+  timelapseScript = pkgs.writeShellApplication {
+    name = "timelapse-test";
+    text = ''
+      date >> /tmp/timelapse-test
+      sleep 5m
+    '';
+  };
 in
 {
   imports = [
@@ -53,6 +61,18 @@ in
     };
   };
 
+  systemd = {
+    timers.timelapse-test = {
+      timerConfig.onCalendar = "*-*-* *:*:30";
+    };
+    services.timelapse-test.serviceConfig = {
+      ExecStart = lib.getExe timelapseScript;
+      StateDirectory = "timelapse-test";
+      Type = "simple";
+      RuntimeMaxSec = "30s";
+    };
+  };
+
   swapDevices = [
     {
       device = "${nvme}-part2";
diff --git a/modules/services/timelapse-r11/default.nix b/modules/services/timelapse-r11/default.nix
index 0dd1c93..f6acf6b 100644
--- a/modules/services/timelapse-r11/default.nix
+++ b/modules/services/timelapse-r11/default.nix
@@ -61,7 +61,7 @@ in
         StateDirectory = "timelapse-r11";
         DynamicUser = true;
         Type = "simple";
-        RuntimeMaxSecs = "45s";
+        RuntimeMaxSec = "45s";
       };
     };