1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/systems/zaatar/spotifyd.nix
2023-06-27 20:13:09 +02:00

38 lines
1005 B
Nix

{
config,
inputs,
...
}: {
services.spotifyd = {
enable = true;
settings = {
global = {
username_cmd = "cat $CREDENTIALS_DIRECTORY/username";
password_cmd = "cat $CREDENTIALS_DIRECTORY/password";
backend = "pulseaudio";
bitrate = 320;
device_type = "s_t_b"; # set-top box
device_name = config.networking.hostName;
};
};
};
systemd.services.spotifyd = {
serviceConfig.LoadCredential = [
"username:${config.age.secrets.spotify-username.path}"
"password:${config.age.secrets.spotify-password.path}"
];
};
age.secrets = {
spotify-username.file = inputs.secrets + "/spotify-username.age";
spotify-password.file = inputs.secrets + "/spotify-password.age";
};
# 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
'';
}