nix-config/hosts/capibara/snapcast.nix

27 lines
626 B
Nix
Raw Normal View History

2023-08-19 18:36:21 +02:00
{ config, pkgs, ... }:
{
services.snapserver = {
enable = true;
codec = "flac";
2023-08-19 19:00:18 +02:00
http.docRoot = "${pkgs.snapcast}/share/snapserver/snapweb";
2023-08-19 18:36:21 +02:00
streams = {
pipewire = {
type = "pipe";
location = "/run/snapserver/pipewire";
};
};
};
systemd.user.services.snapcast-sink = {
wantedBy = [ "pipewire.service" ];
after = [ "pipewire.service" ];
bindsTo = [ "pipewire.service" ];
path = with pkgs; [ gawk pulseaudio ];
script = ''
pactl load-module module-pipe-sink file=/run/snapserver/pipewire sink_name=Snapcast format=s16le rate=48000
'';
};
}