jellfin cronjobs
This commit is contained in:
@@ -3,7 +3,10 @@ let
|
||||
localhost = config.my.servers.settings.localhost;
|
||||
port = 8096;
|
||||
in {
|
||||
options.my.servers.jellyfin.enable = lib.mkEnableOption "enable";
|
||||
options.my.servers.jellyfin = {
|
||||
enable = lib.mkEnableOption "enable";
|
||||
enableCron = lib.mkEnableOption "enable";
|
||||
};
|
||||
config = lib.mkIf config.my.servers.jellyfin.enable {
|
||||
environment.systemPackages = [ pkgs.jellyfin-ffmpeg ];
|
||||
services = {
|
||||
@@ -99,5 +102,33 @@ in {
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd = lib.mkIf config.my.servers.jellyfin.enableCron {
|
||||
services = {
|
||||
sub-sync = let
|
||||
sub-sync = pkgs.writeScriptBin "nextcloud-cronjob"
|
||||
(builtins.readFile ../../scripts/sub-sync.sh);
|
||||
in {
|
||||
restartIfChanged = true;
|
||||
description = "syncronizes subtitles downloaded & modified today";
|
||||
wantedBy = [ "default.target" ];
|
||||
path = [ pkgs.nix sub-sync ];
|
||||
serviceConfig = {
|
||||
Restart = "on-failure";
|
||||
RestartSec = 30;
|
||||
ExecStart = "${sub-sync}/bin/sub-sync all";
|
||||
Type = "forking";
|
||||
User = "root";
|
||||
};
|
||||
};
|
||||
};
|
||||
timers = {
|
||||
sub-sync = {
|
||||
enable = true;
|
||||
description = "syncronizes subtitles downloaded & modified today";
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = { OnCalendar = "20:00"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user