2024-05-10 20:34:15 +03:00
|
|
|
{ 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 {
|
2024-05-10 20:34:15 +03:00
|
|
|
systemd.services.photos_process = util.mkStaticSystemdService {
|
2024-03-04 00:34:39 +03:00
|
|
|
enable = true;
|
|
|
|
description = "Process uploaded photos.";
|
|
|
|
serviceConfig = {
|
2024-04-08 18:26:01 +03:00
|
|
|
Type = "oneshot";
|
2024-03-04 00:34:39 +03:00
|
|
|
};
|
|
|
|
path = with pkgs; [
|
|
|
|
docker
|
|
|
|
];
|
2024-04-08 18:26:01 +03:00
|
|
|
script = script;
|
2024-03-04 00:34:39 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
systemd.timers.photos_process = {
|
|
|
|
timerConfig = {
|
|
|
|
OnCalendar = "daily";
|
|
|
|
Persistent = true;
|
|
|
|
Unit = "photos_process.service";
|
|
|
|
};
|
|
|
|
wantedBy = [ "timers.target" ];
|
|
|
|
};
|
|
|
|
}
|