new timer
This commit is contained in:
parent
a9a474fb0d
commit
82e5c613b4
1 changed files with 36 additions and 0 deletions
36
modules/timers/rooms.nix
Normal file
36
modules/timers/rooms.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue