mx: add timer for blog rendering
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
parent
946f44ee51
commit
ac0bff93f5
|
@ -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.$$
|
||||
rm -fr $DIR
|
||||
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
|
||||
rm -fr $DIR
|
||||
''
|
||||
);
|
||||
};
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.timers = {
|
||||
render_blog = {
|
||||
Timer = {
|
||||
OnCalendar = "hourly";
|
||||
};
|
||||
Install.WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue