nixos/music-assistant: fix yt-dlp challenge solving for YouTube Music

The YouTube Music provider uses yt-dlp, which in turn wants ffmpeg and
deno in the $PATH. Additionally, deno uses JIT for which we have to
relax our unit sandboxing.
This commit is contained in:
emilylange
2025-11-17 19:02:10 +01:00
parent 8fd3b130c9
commit 14c9bfb2c5

View File

@@ -26,6 +26,9 @@ let
finalPackage = cfg.package.override { finalPackage = cfg.package.override {
inherit (cfg) providers; inherit (cfg) providers;
}; };
# YouTube Music needs deno with JIT to solve yt-dlp challenges
useYTMusic = lib.elem "ytmusic" cfg.providers;
in in
{ {
@@ -89,6 +92,10 @@ in
] ]
++ lib.optionals (lib.elem "snapcast" cfg.providers) [ ++ lib.optionals (lib.elem "snapcast" cfg.providers) [
snapcast snapcast
]
++ lib.optionals useYTMusic [
deno
ffmpeg
]; ];
serviceConfig = { serviceConfig = {
@@ -104,7 +111,7 @@ in
CapabilityBoundingSet = [ "" ]; CapabilityBoundingSet = [ "" ];
DevicePolicy = "closed"; DevicePolicy = "closed";
LockPersonality = true; LockPersonality = true;
MemoryDenyWriteExecute = true; MemoryDenyWriteExecute = !useYTMusic;
ProcSubset = "pid"; ProcSubset = "pid";
ProtectClock = true; ProtectClock = true;
ProtectControlGroups = true; ProtectControlGroups = true;
@@ -125,6 +132,9 @@ in
SystemCallFilter = [ SystemCallFilter = [
"@system-service" "@system-service"
"~@privileged @resources" "~@privileged @resources"
]
++ lib.optionals useYTMusic [
"@pkey"
]; ];
RestrictSUIDSGID = true; RestrictSUIDSGID = true;
UMask = "0077"; UMask = "0077";