1
0
Fork 0
nixos-config/home-manager/roles/fetch-banking-timer.nix
2021-09-18 11:05:10 +02:00

30 lines
767 B
Nix

{ 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
git add */prices
git commit -m "Load transactions and balances"
git push
fi
''
);
};
};
timers.fetch-banking = {
Unit.Description = "Fetch banking";
Timer.OnCalendar = "hourly";
Install.WantedBy = [ "timers.target" ];
};
};
}