automatically restart spotifyd and pulseaudio daily

This commit is contained in:
busti 2022-01-22 17:22:02 +01:00
parent c5349029ab
commit f868637417

View file

@ -1,4 +1,4 @@
{ config, ... }:
{ config, pkgs, ... }:
{
disabledModules = [ "services/audio/spotifyd.nix" ];
@ -15,4 +15,22 @@
networking.firewall.allowedTCPPorts = [ 4070 config.services.spotifyd.settings.global.zeroconf_port ];
networking.firewall.allowedUDPPorts = [ 5353 ];
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";
};
};
}