nix/host/home/PhotosProcess.nix

29 lines
665 B
Nix
Raw Normal View History

{ pkgs, util, ... }: let
2024-04-08 18:26:01 +03:00
script = ''
in="/storage/hot/docker/cloud/data/data/cakee/files/media/photo/"
out="/storage/cold_1/backup/tmp/photo/"
docker run --rm -v "''${in}":/in -v "''${out}":/out voronind.com/photoprocess:latest
'';
in {
systemd.services.photos_process = util.mkStaticSystemdService {
enable = true;
description = "Process uploaded photos.";
serviceConfig = {
2024-04-08 18:26:01 +03:00
Type = "oneshot";
};
path = with pkgs; [
docker
];
2024-04-08 18:26:01 +03:00
script = script;
};
systemd.timers.photos_process = {
timerConfig = {
OnCalendar = "daily";
Persistent = true;
Unit = "photos_process.service";
};
wantedBy = [ "timers.target" ];
};
}