Loading nixos/modules/services/audio/music-assistant.nix +11 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,14 @@ in }; config = mkIf cfg.enable { services.avahi = lib.mkIf (lib.elem "airplay_receiver" cfg.providers) { enable = true; publish = { enable = true; userServices = true; }; }; systemd.services.music-assistant = { description = "Music Assistant"; documentation = [ "https://music-assistant.io" ]; Loading @@ -87,6 +95,9 @@ in [ lsof ] ++ lib.optionals (lib.elem "airplay_receiver" cfg.providers) [ shairport-sync ] ++ lib.optionals (lib.elem "spotify" cfg.providers) [ librespot-ma ] Loading pkgs/by-name/mu/music-assistant/package.nix +6 −1 Original line number Diff line number Diff line Loading @@ -66,6 +66,9 @@ python.pkgs.buildPythonApplication rec { # Look up librespot from PATH at runtime ./librespot.patch # Look up shairport-sync from PATH at runtime ./shairport-sync.patch # Disable interactive dependency resolution, which clashes with the immutable Python environment ./dont-install-deps.patch Loading @@ -91,7 +94,9 @@ python.pkgs.buildPythonApplication rec { substituteInPlace pyproject.toml \ --replace-fail "get-mac" "getmac" rm -rv music_assistant/providers/spotify/bin rm -rv \ music_assistant/providers/airplay_receiver/bin/{build_binaries.sh,shairport-sync-*} \ music_assistant/providers/spotify/bin ''; build-system = with python.pkgs; [ Loading pkgs/by-name/mu/music-assistant/shairport-sync.patch 0 → 100644 +20 −0 Original line number Diff line number Diff line diff --git a/music_assistant/providers/airplay_receiver/helpers.py b/music_assistant/providers/airplay_receiver/helpers.py index 6f2b35df..dd839b73 100644 --- a/music_assistant/providers/airplay_receiver/helpers.py +++ b/music_assistant/providers/airplay_receiver/helpers.py @@ -22,15 +22,9 @@ async def check_shairport_sync(shairport_path: str) -> str | None: except OSError: return None - # First, check if bundled binary exists - base_path = os.path.join(os.path.dirname(__file__), "bin") system = platform.system().lower().replace("darwin", "macos") architecture = platform.machine().lower() - if shairport_binary := await check_shairport_sync( - os.path.join(base_path, f"shairport-sync-{system}-{architecture}") - ): - return shairport_binary # If no bundled binary, check system PATH if system_binary := shutil.which("shairport-sync"): Loading
nixos/modules/services/audio/music-assistant.nix +11 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,14 @@ in }; config = mkIf cfg.enable { services.avahi = lib.mkIf (lib.elem "airplay_receiver" cfg.providers) { enable = true; publish = { enable = true; userServices = true; }; }; systemd.services.music-assistant = { description = "Music Assistant"; documentation = [ "https://music-assistant.io" ]; Loading @@ -87,6 +95,9 @@ in [ lsof ] ++ lib.optionals (lib.elem "airplay_receiver" cfg.providers) [ shairport-sync ] ++ lib.optionals (lib.elem "spotify" cfg.providers) [ librespot-ma ] Loading
pkgs/by-name/mu/music-assistant/package.nix +6 −1 Original line number Diff line number Diff line Loading @@ -66,6 +66,9 @@ python.pkgs.buildPythonApplication rec { # Look up librespot from PATH at runtime ./librespot.patch # Look up shairport-sync from PATH at runtime ./shairport-sync.patch # Disable interactive dependency resolution, which clashes with the immutable Python environment ./dont-install-deps.patch Loading @@ -91,7 +94,9 @@ python.pkgs.buildPythonApplication rec { substituteInPlace pyproject.toml \ --replace-fail "get-mac" "getmac" rm -rv music_assistant/providers/spotify/bin rm -rv \ music_assistant/providers/airplay_receiver/bin/{build_binaries.sh,shairport-sync-*} \ music_assistant/providers/spotify/bin ''; build-system = with python.pkgs; [ Loading
pkgs/by-name/mu/music-assistant/shairport-sync.patch 0 → 100644 +20 −0 Original line number Diff line number Diff line diff --git a/music_assistant/providers/airplay_receiver/helpers.py b/music_assistant/providers/airplay_receiver/helpers.py index 6f2b35df..dd839b73 100644 --- a/music_assistant/providers/airplay_receiver/helpers.py +++ b/music_assistant/providers/airplay_receiver/helpers.py @@ -22,15 +22,9 @@ async def check_shairport_sync(shairport_path: str) -> str | None: except OSError: return None - # First, check if bundled binary exists - base_path = os.path.join(os.path.dirname(__file__), "bin") system = platform.system().lower().replace("darwin", "macos") architecture = platform.machine().lower() - if shairport_binary := await check_shairport_sync( - os.path.join(base_path, f"shairport-sync-{system}-{architecture}") - ): - return shairport_binary # If no bundled binary, check system PATH if system_binary := shutil.which("shairport-sync"):