new timer

This commit is contained in:
KoenDR06 2025-09-16 23:51:12 +02:00
parent a9a474fb0d
commit 82e5c613b4

36
modules/timers/rooms.nix Normal file
View file

@ -0,0 +1,36 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.horseman.timers.rooms;
in {
options = {
horseman.timers.rooms = {
enable = mkEnableOption "Runs a script to search for student housing";
};
};
config = mkIf cfg.enable {
systemd.timers."rooms" = {
wantedBy = ["timers.target"];
timerConfig = {
OnCalendar = "*-*-* 23:00:00"; # Every day at 23:00
Persistent = true;
};
};
systemd.services."rooms" = {
script = ''
cd /home/horseman/Programming
java -jar KamerZoeken-1.0.0.jar headless
'';
serviceConfig = {
Type = "oneshot";
User = "root";
};
};
};
}