2024-05-10 20:34:15 +03:00
|
|
|
{ pkgs, util, ... }: let
|
2024-04-08 18:26:01 +03:00
|
|
|
script = ''
|
|
|
|
music="/storage/hot/media/music/"
|
|
|
|
docker run --rm -v "''${music}":/music voronind.com/yamusic:latest
|
|
|
|
'';
|
|
|
|
in {
|
2024-05-10 20:34:15 +03:00
|
|
|
systemd.services.yandex_music = util.mkStaticSystemdService {
|
2024-03-04 00:34:39 +03:00
|
|
|
enable = true;
|
|
|
|
description = "Sync music from Yandex.Music.";
|
|
|
|
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.yandex_music = {
|
|
|
|
timerConfig = {
|
|
|
|
OnCalendar = "daily";
|
|
|
|
Persistent = true;
|
|
|
|
Unit = "yandex_music.service";
|
|
|
|
};
|
|
|
|
wantedBy = [ "timers.target" ];
|
|
|
|
};
|
|
|
|
}
|