rclone sync music to hetzner-vm as webdav 404s on some songs

This commit is contained in:
Chaos 2022-12-15 12:09:31 +00:00
parent f6db6c33c9
commit 39ab88cf0c
No known key found for this signature in database
2 changed files with 39 additions and 2 deletions

View file

@ -91,7 +91,7 @@ in {
};
};
systemd.services.mdadm-monitor = {
systemd.services.mdmonitor = {
requires = ["network.target"];
wantedBy = ["multi-user.target"];
path = with pkgs; [mdadm msmtp];

View file

@ -8,10 +8,47 @@
in {
environment.systemPackages = with pkgs; [mpc_cli];
systemd.tmpfiles.rules = [
"d /Music - root root"
];
systemd.services.music-sync = {
wantedBy = ["multi-user.target"];
after = ["network.target"];
partOf = ["mpd.service"];
path = with pkgs; [bash rclone mount umount];
script = let
rclone_config = pkgs.writeText "rclone.conf" ''
[Music]
type = webdav
url = https://storage-webdav.owo.monster/music_ro/
vendor = nextcloud
'';
in ''
set -e
rclone --config ${rclone_config} sync Music: /Music
'';
};
systemd.timers.music-sync = {
wantedBy = ["timers.target"];
partOf = ["music-sync.service"];
timerConfig.OnCalendar = "hourly";
};
systemd.services.mpd = {
after = ["music-copy.service"];
};
services.mpd = {
enable = true;
network.listenAddress = "0.0.0.0";
musicDirectory = "https://storage-webdav.owo.monster/music_ro/";
dataDir = "/mpd";
playlistDirectory = "/mpd/playlists";
musicDirectory = "/Music";
user = "root";
group = "root";
credentials = [
{
passwordFile = "${secrets.mpd_control_password.path}";