2021-08-16 19:04:08 +00:00
|
|
|
{ pkgs, ... }: {
|
|
|
|
systemd.user = {
|
|
|
|
services.fetch-banking = {
|
|
|
|
Unit.Description = "Fetch banking";
|
|
|
|
Service = {
|
|
|
|
Type = "oneshot";
|
|
|
|
ExecStart = toString (
|
|
|
|
pkgs.writeShellScript "fetch-banking" ''
|
|
|
|
set -e
|
|
|
|
cd ~/git/buchhaltung
|
|
|
|
git pull
|
|
|
|
shake fetch
|
|
|
|
if [[ "$(git status --porcelain */raw)" != "" ]]; then
|
|
|
|
git add */raw
|
2021-09-06 12:06:41 +00:00
|
|
|
git add */prices
|
2021-08-16 19:04:08 +00:00
|
|
|
git commit -m "Load transactions and balances"
|
|
|
|
git push
|
|
|
|
fi
|
|
|
|
''
|
|
|
|
);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
timers.fetch-banking = {
|
|
|
|
Unit.Description = "Fetch banking";
|
2021-09-18 09:05:10 +00:00
|
|
|
Timer.OnCalendar = "hourly";
|
2021-08-16 19:04:08 +00:00
|
|
|
Install.WantedBy = [ "timers.target" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|