rclone sync music to hetzner-vm as webdav 404s on some songs
This commit is contained in:
parent
f6db6c33c9
commit
39ab88cf0c
|
@ -91,7 +91,7 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
systemd.services.mdadm-monitor = {
|
||||
systemd.services.mdmonitor = {
|
||||
requires = ["network.target"];
|
||||
wantedBy = ["multi-user.target"];
|
||||
path = with pkgs; [mdadm msmtp];
|
||||
|
|
|
@ -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}";
|
||||
|
|
Loading…
Reference in a new issue