From 48ce381be0ca3f1c939400d335dfa74fb62f282b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Wed, 24 Mar 2021 20:26:05 +0100 Subject: [PATCH] fix(spotifyd): run correctly with systemWide pulseaudio --- configs/spotifyd.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/configs/spotifyd.nix b/configs/spotifyd.nix index 8df9532..350a825 100644 --- a/configs/spotifyd.nix +++ b/configs/spotifyd.nix @@ -1,4 +1,4 @@ -{ lib, ... }: +{ config, lib, ... }: { services.spotifyd = { enable = true; @@ -6,9 +6,19 @@ global = { username = lib.strings.fileContents ; password = lib.strings.fileContents ; + backend = "pulseaudio"; + bitrate = 320; + device_type = "s_t_b"; # set-top box + device_name = config.networking.hostName; }; }; }; + # ref https://github.com/NixOS/nixpkgs/issues/71362#issuecomment-753461502 + hardware.pulseaudio.extraConfig = '' + unload-module module-native-protocol-unix + load-module module-native-protocol-unix auth-anonymous=1 + ''; + systemd.services.spotifyd.serviceConfig.Restart = "always"; }