feat(aspen/system): Setup a systemd timer to sync the depot public inbox
Change-Id: Iaeae18af25b00b04bd805dabb320c218cb21fd8f Reviewed-on: https://cl.tvl.fyi/c/depot/+/12545 Tested-by: BuildkiteCI Autosubmit: aspen <root@gws.fyi> Reviewed-by: aspen <root@gws.fyi>
This commit is contained in:
		
							parent
							
								
									e9d10753d5
								
							
						
					
					
						commit
						278ffa2b05
					
				
					 2 changed files with 29 additions and 4 deletions
				
			
		| 
						 | 
					@ -1,14 +1,13 @@
 | 
				
			||||||
{ pkgs, lib, config, ... }:
 | 
					{ pkgs, lib, config, ... }:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
let
 | 
					let inherit (builtins) pathExists;
 | 
				
			||||||
  inherit (builtins) pathExists;
 | 
					in {
 | 
				
			||||||
in
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  imports = [
 | 
					  imports = [
 | 
				
			||||||
    ../platforms/linux.nix
 | 
					    ../platforms/linux.nix
 | 
				
			||||||
    ../modules/common.nix
 | 
					    ../modules/common.nix
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ../modules/email.nix
 | 
					    ../modules/email.nix
 | 
				
			||||||
 | 
					    ../modules/depot-inbox.nix
 | 
				
			||||||
    ../modules/desktop.nix
 | 
					    ../modules/desktop.nix
 | 
				
			||||||
  ] ++ (lib.optional (pathExists ../modules/private.nix)
 | 
					  ] ++ (lib.optional (pathExists ../modules/private.nix)
 | 
				
			||||||
    ../modules/private.nix);
 | 
					    ../modules/private.nix);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										26
									
								
								users/aspen/system/home/modules/depot-inbox.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								users/aspen/system/home/modules/depot-inbox.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,26 @@
 | 
				
			||||||
 | 
					{ config, lib, pkgs, ... }:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					let
 | 
				
			||||||
 | 
					  depot = config.lib.depot;
 | 
				
			||||||
 | 
					in
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  systemd.user = {
 | 
				
			||||||
 | 
					    services.sync-depot-public-inbox = {
 | 
				
			||||||
 | 
					      Service.ExecStart = pkgs.writeShellScript "sync-depot-public-inbox" ''
 | 
				
			||||||
 | 
					        ${depot.tools.fetch-depot-inbox}/bin/fetch-depot-inbox \
 | 
				
			||||||
 | 
					          /home/aspen/mail/tvl/
 | 
				
			||||||
 | 
					        ${pkgs.notmuch}/bin/notmuch new
 | 
				
			||||||
 | 
					      '';
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    timers.sync-depot-public-inbox = {
 | 
				
			||||||
 | 
					      Unit.Description = "Sync the depot public inbox";
 | 
				
			||||||
 | 
					      Timer = {
 | 
				
			||||||
 | 
					        OnCalendar = "*:*";
 | 
				
			||||||
 | 
					        Unit = "sync-depot-public-inbox.service";
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					      Install.WantedBy = [ "timers.target" ];
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue