hosts/pi: add snapcast
All checks were successful
Check flake / build-amd64-linux (push) Successful in 1m15s
All checks were successful
Check flake / build-amd64-linux (push) Successful in 1m15s
This commit is contained in:
@ -9,6 +9,7 @@
|
|||||||
inputs.nixos-hardware.nixosModules.raspberry-pi-4
|
inputs.nixos-hardware.nixosModules.raspberry-pi-4
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./home-assistant
|
./home-assistant
|
||||||
|
./snapcast.nix
|
||||||
../server.nix
|
../server.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
43
hosts/pi/snapcast.nix
Normal file
43
hosts/pi/snapcast.nix
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Put all sinks in pipewire group
|
||||||
|
services.pipewire.systemWide = true;
|
||||||
|
|
||||||
|
services.avahi = {
|
||||||
|
enable = true;
|
||||||
|
nssmdns4 = true;
|
||||||
|
publish = {
|
||||||
|
enable = true;
|
||||||
|
domain = true;
|
||||||
|
addresses = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.snapserver = {
|
||||||
|
enable = true;
|
||||||
|
streams = {
|
||||||
|
default = {
|
||||||
|
type = "file";
|
||||||
|
location = "/var/lib/snapserver/test.wav";
|
||||||
|
sampleFormat = "44100:16:2";
|
||||||
|
codec = "flac";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.snapclient = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "pipewire.service" ];
|
||||||
|
requires = [ "pipewire.service" ];
|
||||||
|
description = "Snapcast client";
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${pkgs.snapcast}/bin/snapclient -h 127.0.0.1 --player pulse --mixer hardware";
|
||||||
|
DynamicUser = true;
|
||||||
|
SupplementaryGroups = [ "pipewire" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Reference in New Issue
Block a user