Add Spotify Connect receiver using librespot

This commit is contained in:
June 2023-10-16 22:29:09 +02:00
parent abce3dee7a
commit 28cd59c957
2 changed files with 33 additions and 0 deletions

View file

@ -2,6 +2,7 @@
{ {
imports = [ imports = [
./configuration.nix ./configuration.nix
./librespot.nix
./networking.nix ./networking.nix
./shairport-sync.nix ./shairport-sync.nix
]; ];

View file

@ -0,0 +1,32 @@
# 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 = { };
};
}