Update hosts/hetzner-arm/containers/music/profiles/mpd.nix
This commit is contained in:
parent
7c690ae2a6
commit
ac31abc207
|
@ -14,28 +14,21 @@ in {
|
|||
mpc_cli
|
||||
];
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /var/lib/mpd - mpd mpd"
|
||||
"d /var/lib/mpd/state - mpd mpd"
|
||||
|
||||
"d /caches - root root"
|
||||
"d /caches/music_serve - mpd mpd"
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /Music - mpd mpd"
|
||||
];
|
||||
|
||||
systemd.services.mpd = {
|
||||
wants = ["rclone-serve-nfs-music.service"];
|
||||
after = ["rclone-serve-nfs-music.service"];
|
||||
serviceConfig = {
|
||||
ProtectSystem = false;
|
||||
AmbientCapabilities = "CAP_NET_BIND_SERVICE";
|
||||
CapabilityBoundingSet = "CAP_NET_BIND_SERVICE";
|
||||
ReadOnlyPaths = "/Music";
|
||||
};
|
||||
};
|
||||
|
||||
services.mpd = {
|
||||
enable = true;
|
||||
network.listenAddress = "0.0.0.0";
|
||||
musicDirectory = "nfs://127.0.0.1:2049/?version=3";
|
||||
musicDirectory = "/Music";
|
||||
dbFile = null;
|
||||
credentials = [
|
||||
{
|
||||
|
@ -93,35 +86,4 @@ in {
|
|||
}
|
||||
'';
|
||||
};
|
||||
|
||||
services.rclone-serve = {
|
||||
enable = true;
|
||||
remotes = [
|
||||
{
|
||||
id = "main";
|
||||
remote = "Music:";
|
||||
type = "nfs";
|
||||
user = "mpd";
|
||||
serviceConfig = {
|
||||
before = ["mpd.service"];
|
||||
partOf = ["mpd.service"];
|
||||
};
|
||||
extraArgs = let
|
||||
rcloneConfig = builtins.toFile "rclone.conf" ''
|
||||
[Music]
|
||||
type = webdav
|
||||
url = https://storage-webdav.owo.monster/MusicRO/
|
||||
vendor = other
|
||||
'';
|
||||
in [
|
||||
"--addr=127.0.0.1:2049"
|
||||
"--config=${rcloneConfig}"
|
||||
"--cache-dir=/caches/music_serve"
|
||||
"--vfs-cache-max-age=7d"
|
||||
"--vfs-cache-max-size=4g"
|
||||
"--vfs-cache-mode=full"
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue