mx: add timer for blog rendering
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
		
							parent
							
								
									946f44ee51
								
							
						
					
					
						commit
						1ee17f040b
					
				
					 1 changed files with 32 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -31,5 +31,37 @@
 | 
			
		|||
 | 
			
		||||
  xdg.enable = true;
 | 
			
		||||
  xdg.mime.enable = true;
 | 
			
		||||
 | 
			
		||||
  systemd.user.services = {
 | 
			
		||||
    render_blog = {
 | 
			
		||||
      Service = {
 | 
			
		||||
        Type = "oneshot";
 | 
			
		||||
        ExecStart = toString (
 | 
			
		||||
          pkgs.writeShellScript "render_blog.sh" ''
 | 
			
		||||
            set -eou pipefail
 | 
			
		||||
            DIR=/var/tmp/blog.$$
 | 
			
		||||
            ${pkgs.coreutils}/bin/rm -fr $DIR
 | 
			
		||||
            ${pkgs.coreutils}/bin/mkdir -p $DIR
 | 
			
		||||
            cd $DIR
 | 
			
		||||
            ${pkgs.git}/bin/git clone --recurse-submodules https://git.hoyer.xyz/harald/blog.git
 | 
			
		||||
            cd blog
 | 
			
		||||
            ./build.sh
 | 
			
		||||
            cd /var/tmp
 | 
			
		||||
            ${pkgs.coreutils}/bin/rm -fr $DIR
 | 
			
		||||
          ''
 | 
			
		||||
        );
 | 
			
		||||
      };
 | 
			
		||||
      Install.WantedBy = [ "default.target" ];
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  systemd.user.timers = {
 | 
			
		||||
    render_blog = {
 | 
			
		||||
      Timer = {
 | 
			
		||||
        OnCalendar = "hourly";
 | 
			
		||||
      };
 | 
			
		||||
      Install.WantedBy = [ "timers.target" ];
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue