nixos-configuration/hosts/iron/services/snapcast/snapclient.nix
2025-10-14 23:18:44 +02:00

24 lines
801 B
Nix

{ pkgs, ... }:
{
systemd.services.snapclient = {
enable = true;
description = "Snapcast client";
wants = [ "network.target" "sound.target" ];
after = [ "network.target" "sound.target" ];
wantedBy = [ "multi-user.target" ];
environment.PULSE_SERVER = "unix:/run/pulse/native";
serviceConfig = {
DynamicUser = "yes";
ExecStart = "${pkgs.snapcast}/bin/snapclient --host 127.0.0.1 --player pulse -s alsa_output.usb-Burr-Brown_from_TI_USB_Audio_DAC-00.analog-stereo";
Group = "pipewire";
NoNewPrivileges = true;
ProtectControlGroups = true;
ProtectHome = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
RestrictAddressFamilies = "AF_INET AF_INET6 AF_UNIX";
RestrictNamespaces = true;
};
};
}