1
0
Fork 0

Fetch banking job

This commit is contained in:
Malte Brandy 2021-08-16 21:04:08 +02:00
parent e82545d99e
commit 9a7c4ca64c
2 changed files with 30 additions and 1 deletions

View file

@ -39,6 +39,7 @@ let
};
on-my-machines = [
./roles/on-my-machine.nix
./roles/accounting.nix
./roles/mail.nix
./roles/kassandra.nix
./roles/taskwarrior.nix
@ -54,7 +55,6 @@ let
(import ./roles/firefox.nix "http://localhost:8842")
(makeAutostart "kassandra2")
(makeAutostart "unlock-ssh")
./roles/accounting.nix
./roles/beets.nix
./roles/daily-driver-programs.nix
./roles/desktop-items.nix
@ -102,6 +102,7 @@ in
];
hera = {
default = makeConfig "hera" (on-my-machines ++ [
./roles/fetch-banking-timer.nix
./roles/weechat
./roles/mail2rss.nix
./roles/headless-mpd.nix

View file

@ -0,0 +1,28 @@
{ 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 commit -m "Load transactions and balances"
git push
fi
''
);
};
};
timers.fetch-banking = {
Unit.Description = "Fetch banking";
Timer.OnCalendar = "hourly";
Install.WantedBy = [ "timers.target" ];
};
};
}