2021-06-07 10:58:58 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
2020-10-28 21:43:33 +01:00
|
|
|
{
|
2021-06-08 20:26:38 +02:00
|
|
|
imports = [ <niveum/modules/spotifyd.nix> ];
|
|
|
|
|
disabledModules = [ "services/audio/spotifyd.nix" ];
|
|
|
|
|
|
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 = {
|
2020-10-28 21:43:33 +01:00
|
|
|
username = lib.strings.fileContents <secrets/spotify/username>;
|
|
|
|
|
password = lib.strings.fileContents <secrets/spotify/password>;
|
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
|
|
|
|
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
|
|
|
}
|