nix-infra/config/hosts/audio/librespot.nix

33 lines
1,011 B
Nix
Raw Normal View History

# Sources for this configuration:
# - https://github.com/librespot-org/librespot
# - https://github.com/librespot-org/librespot/wiki/Options
# - https://github.com/librespot-org/librespot/wiki/Audio-Backends
{ config, pkgs, ... }:
{
systemd.services.spotify-connect-receiver = {
enable = true;
description = "Spotify Connect Receiver Using librespot";
unitConfig = {
Requires = [ "network-online.target" "pipewire.service" ];
After = [ "network-online.target" "pipewire.service" ];
};
serviceConfig = {
ExecStart = "${pkgs.librespot}/bin/librespot --name 'Z9 Hauptraum' --device-type speaker --bitrate 320 --enable-volume-normalisation --disable-audio-cache --disable-credential-cache --quiet";
User = "librespot";
Group = "librespot";
};
wantedBy = [ "multi-user.target" ];
};
users = {
users.librespot = {
isSystemUser = true;
group = "librespot";
extraGroups = [ "pipewire" ];
};
groups.librespot = { };
};
}