nix-infra/modules/services/audio/librespot.nix
jopejoe1 4fc8e31df0
Remove version lock for shairport-sync
The current version in nixpkgs is newer than the one we are currently locking, the nqptp fix was also already in nixpkgs.

Co-authored-by: c6ristian <c6ristian@christian.moe>
2024-11-04 23:35:22 +01:00

42 lines
1.1 KiB
Nix

# 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, lib, ... }:
with lib;
let
cfg = config.ccchh.services.audio;
in
{
config = mkIf cfg.enable {
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 '${config.ccchh.services.audio.name}' --device-type speaker --bitrate 320 --enable-volume-normalisation --disable-audio-cache --disable-credential-cache";
User = "librespot";
Group = "librespot";
};
wantedBy = [ "multi-user.target" ];
};
users = {
users.librespot = {
isSystemUser = true;
group = "librespot";
extraGroups = [ "pipewire" "audio" ];
};
groups.librespot = { };
};
};
}