nixos-configs/devices/nos/modules/subtitles/syncing.nix

43 lines
1 KiB
Nix
Raw Normal View History

{
config,
pkgs,
2024-04-04 08:57:19 -04:00
subsync,
...
}: let
inherit (config.vars) mainUser;
2024-04-04 08:57:19 -04:00
subsyncPkg = subsync.packages.${pkgs.system}.default;
node-syncsub = pkgs.callPackage ./node-syncsub {
2024-04-04 08:57:19 -04:00
subsync = subsyncPkg;
};
in {
2024-04-04 08:57:19 -04:00
environment.systemPackages = [subsyncPkg node-syncsub];
systemd = {
services.subsync-job = {
serviceConfig = {
Type = "oneshot";
User = mainUser;
Group = config.users.users.${mainUser}.group;
};
2024-05-05 23:07:06 -04:00
path = [
pkgs.findutils
node-syncsub
];
script = ''
2024-04-08 19:48:57 -04:00
find /data/movies -name '*.mkv' -printf "%h\0" | xargs -0 -I '{}' node-syncsub '{}' "eng,fre"
# find /data/anime -name '*.mkv' -printf "%h\0" | xargs -0 -I '{}' node-syncsub '{}' "eng,fre"
# find /data/tv -name '*.mkv' -printf "%h\0" | xargs -0 -I '{}' node-syncsub '{}' "eng,fre"
'';
};
2024-04-04 08:57:19 -04:00
#timers.subsync-job = {
# wantedBy = ["timers.target"];
# partOf = ["subsync-job.service"];
# timerConfig.OnCalendar = ["0:00:00"];
#};
};
}