diff --git a/homes/x86_64-linux/harald@mx/default.nix b/homes/x86_64-linux/harald@mx/default.nix index 0ec0cb6..223b6e2 100644 --- a/homes/x86_64-linux/harald@mx/default.nix +++ b/homes/x86_64-linux/harald@mx/default.nix @@ -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" ]; + }; + }; }