2022-01-22 16:22:02 +00:00
|
|
|
{ config, pkgs, ... }:
|
2021-08-21 16:47:21 +00:00
|
|
|
|
|
|
|
{
|
2022-01-18 20:28:52 +00:00
|
|
|
disabledModules = [ "services/audio/spotifyd.nix" ];
|
|
|
|
imports = [ ../modules/spotifyd.nix ];
|
|
|
|
|
|
|
|
|
2021-08-21 16:47:21 +00:00
|
|
|
services.spotifyd = {
|
|
|
|
enable = true;
|
2022-01-18 20:28:52 +00:00
|
|
|
settings.global = {
|
|
|
|
bitrate = 320;
|
|
|
|
zeroconf_port = 18572;
|
|
|
|
};
|
2021-08-21 16:47:21 +00:00
|
|
|
};
|
|
|
|
|
2022-01-18 20:28:52 +00:00
|
|
|
networking.firewall.allowedTCPPorts = [ 4070 config.services.spotifyd.settings.global.zeroconf_port ];
|
2021-11-04 19:21:19 +00:00
|
|
|
networking.firewall.allowedUDPPorts = [ 5353 ];
|
2022-01-22 16:22:02 +00:00
|
|
|
|
|
|
|
systemd.services.restart-spotifyd = {
|
|
|
|
serviceConfig.Type = "oneshot";
|
|
|
|
script = ''
|
|
|
|
${pkgs.systemd}/bin/systemctl restart spotifyd.service
|
|
|
|
${pkgs.systemd}/bin/systemctl restart pulseaudio.service
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.timers.restart-spotifyd = {
|
|
|
|
wantedBy = [ "timers.target" ];
|
|
|
|
partOf = [ "restart-spotifyd.service" ];
|
|
|
|
timerConfig = {
|
|
|
|
OnCalendar = "*-*-* 07:00:00";
|
|
|
|
Persistent = "True";
|
|
|
|
Unit = "restart-spotifyd.service";
|
|
|
|
};
|
|
|
|
};
|
2021-08-21 16:47:21 +00:00
|
|
|
}
|