Add snapclient user unit

This commit is contained in:
Jakob Lechner 2024-12-08 04:04:25 +01:00
parent c4fb41f93a
commit 2a8c2c2f3b
2 changed files with 22 additions and 1 deletions

View file

@ -18,7 +18,7 @@
./graphics
./gui.nix
./jameica.nix
./kicad.nix
#./kicad.nix FIXME: kicad build fails
./mpv.nix
./mute-indicator.nix
./mycli
@ -32,6 +32,7 @@
./pcmanfm.nix
./python.nix
./remarkable
./snapclient.nix
./sound
./sway
./thunderbird.nix

View file

@ -0,0 +1,20 @@
{ nixosConfig, lib, pkgs, ... }:
lib.mkIf nixosConfig.jalr.gui.enable {
systemd.user.services.snapclient = {
Unit.Description = "Snapcast client";
Service = {
BindPaths = [ "/run/user/1000/pulse" ];
ExecStart = "${pkgs.snapcast}/bin/snapclient --player pulse";
NoNewPrivileges = true;
ProtectControlGroups = true;
ProtectHome = "tmpfs";
ProtectKernelModules = true;
ProtectKernelTunables = true;
RestrictAddressFamilies = "AF_INET AF_INET6 AF_UNIX";
RestrictNamespaces = true;
Type = "simple";
};
Install.WantedBy = [ "default.target" ];
};
}