mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-15 05:39:11 +02:00
wip: migrate client modules
This commit is contained in:
parent
f6d2ff1544
commit
7ce27d5d2f
245 changed files with 20254 additions and 188 deletions
54
modules-clone/nixos/server/spotifyd.nix
Normal file
54
modules-clone/nixos/server/spotifyd.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
{ lib, config, confLib, ... }:
|
||||
let
|
||||
inherit (confLib.gen { name = "spotifyd"; port = 1025; }) servicePort serviceName serviceUser serviceGroup;
|
||||
in
|
||||
{
|
||||
options.swarselmodules.server.${serviceName} = lib.mkEnableOption "enable ${serviceName} on server";
|
||||
config = lib.mkIf config.swarselmodules.server.${serviceName} {
|
||||
users.groups.${serviceGroup} = {
|
||||
gid = 65136;
|
||||
};
|
||||
|
||||
users.users.${serviceUser} = {
|
||||
isSystemUser = true;
|
||||
uid = 65136;
|
||||
group = serviceGroup;
|
||||
extraGroups = [ "audio" "utmp" "pipewire" ];
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ servicePort ];
|
||||
|
||||
services.pipewire.systemWide = true;
|
||||
|
||||
# https://github.com/Spotifyd/spotifyd/issues/1366
|
||||
networking.hosts."0.0.0.0" = [ "apresolve.spotify.com" ];
|
||||
|
||||
# hacky way to enable multi-session
|
||||
# when another user connects, the service will crash and the new user will login
|
||||
systemd.services.spotifyd.serviceConfig.RestartSec = lib.mkForce 1;
|
||||
|
||||
environment.persistence."/state" = lib.mkIf config.swarselsystems.isMicroVM {
|
||||
directories = [
|
||||
{ directory = "/var/cache/private/spotifyd"; }
|
||||
];
|
||||
};
|
||||
|
||||
services.spotifyd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
global = {
|
||||
dbus_type = "session";
|
||||
use_mpris = false;
|
||||
device = "sysdefault:CARD=PCH";
|
||||
# device = "default";
|
||||
device_name = "SwarselSpot";
|
||||
# backend = "pulseaudio";
|
||||
backend = "alsa";
|
||||
# mixer = "alsa";
|
||||
zeroconf_port = servicePort;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue