2024-04-08 18:26:01 +03:00
|
|
|
{ pkgs, ... }: let
|
|
|
|
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-03-04 00:34:39 +03:00
|
|
|
systemd.services.photos_process = {
|
|
|
|
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" ];
|
|
|
|
};
|
|
|
|
}
|