2023-07-04 16:28:26 +02:00
|
|
|
{config, ...}: {
|
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-06-10 13:56:51 +02:00
|
|
|
username_cmd = "cat $CREDENTIALS_DIRECTORY/username";
|
|
|
|
|
password_cmd = "cat $CREDENTIALS_DIRECTORY/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
|
|
|
|
2023-06-10 13:56:51 +02:00
|
|
|
systemd.services.spotifyd = {
|
|
|
|
|
serviceConfig.LoadCredential = [
|
|
|
|
|
"username:${config.age.secrets.spotify-username.path}"
|
|
|
|
|
"password:${config.age.secrets.spotify-password.path}"
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
2023-02-22 10:02:55 +01:00
|
|
|
age.secrets = {
|
2023-07-04 16:28:26 +02:00
|
|
|
spotify-username.file = ../../secrets/spotify-username.age;
|
|
|
|
|
spotify-password.file = ../../secrets/spotify-password.age;
|
2023-02-22 10:02:55 +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-05-20 00:06:26 +02:00
|
|
|
}
|