forked from Yuka/c3h-nixfiles
		
	automatically restart spotifyd and pulseaudio daily
This commit is contained in:
		
							parent
							
								
									c5349029ab
								
							
						
					
					
						commit
						f868637417
					
				
					 1 changed files with 19 additions and 1 deletions
				
			
		|  | @ -1,4 +1,4 @@ | ||||||
| { config, ... }: | { config, pkgs, ... }: | ||||||
| 
 | 
 | ||||||
| { | { | ||||||
|   disabledModules = [ "services/audio/spotifyd.nix" ]; |   disabledModules = [ "services/audio/spotifyd.nix" ]; | ||||||
|  | @ -15,4 +15,22 @@ | ||||||
| 
 | 
 | ||||||
|   networking.firewall.allowedTCPPorts = [ 4070 config.services.spotifyd.settings.global.zeroconf_port ]; |   networking.firewall.allowedTCPPorts = [ 4070 config.services.spotifyd.settings.global.zeroconf_port ]; | ||||||
|   networking.firewall.allowedUDPPorts = [ 5353 ]; |   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"; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue