2020-10-28 21:43:33 +01:00
|
|
|
{
|
2022-03-10 21:52:12 +01:00
|
|
|
config,
|
|
|
|
|
pkgs,
|
|
|
|
|
lib,
|
|
|
|
|
...
|
|
|
|
|
}: {
|
2020-10-28 21:43:33 +01:00
|
|
|
services.spotifyd = {
|
|
|
|
|
enable = true;
|
2021-06-08 20:26:38 +02:00
|
|
|
settings = {
|
2020-05-20 00:06:26 +02:00
|
|
|
global = {
|
2023-02-22 10:02:55 +01:00
|
|
|
username_cmd = "cat ${config.age.secrets.spotify-username.path}";
|
|
|
|
|
password_cmd = "cat ${config.age.secrets.spotify-password.path}";
|
2021-03-24 20:26:05 +01:00
|
|
|
backend = "pulseaudio";
|
|
|
|
|
bitrate = 320;
|
|
|
|
|
device_type = "s_t_b"; # set-top box
|
|
|
|
|
device_name = config.networking.hostName;
|
2020-05-20 00:06:26 +02:00
|
|
|
};
|
2021-06-08 20:26:38 +02:00
|
|
|
};
|
2020-05-20 00:06:26 +02:00
|
|
|
};
|
2020-12-20 19:21:09 +01:00
|
|
|
|
2023-02-22 10:02:55 +01:00
|
|
|
age.secrets = {
|
|
|
|
|
spotify-username.file = ../../secrets/spotify-username.age;
|
|
|
|
|
spotify-password.file = ../../secrets/spotify-password.age;
|
|
|
|
|
};
|
|
|
|
|
|
2021-03-24 20:26:05 +01:00
|
|
|
# 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
|
|
|
|
|
'';
|
|
|
|
|
|
2020-12-20 19:21:09 +01:00
|
|
|
systemd.services.spotifyd.serviceConfig.Restart = "always";
|
2020-05-20 00:06:26 +02:00
|
|
|
}
|