diff --git a/README.md b/README.md index b4e1135..72a8e36 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,32 @@ -Learning golang, writing a simple app to interface with an HTTP API and generate emailable reports from an actualbudget instance +A simple Go service to generate and email reports on a schedule. -# TODO -- [x] Fetch the desired budget file -- [x] Change path to route in API caller -- [x] Trigger a bank sync and see if we can wait for it to finish (looks like it's a blocking call so we can safely sync before reports) -- [x] Fetch the category information for each category as well as the overall groups -- [x] Compile a email-friendly report of the information -- [x] Send the email to the desired parties via SMTP -- [x] Write flake derivation -- [ ] Write flake module and systemd service +# Installation (NixOS) +If you're using NixOS we provide a simple flake module: + +```nix +inputs.actualbudget-report.url = "git+https://git.wanderingcrow.net/TheWanderingCrow/actualbudget-report"; +``` + +Then in your configuration (using sops-nix, you will need to adjust it if you use agenix or alternatives): +```nix +imports = [ + inputs.actualbudget-report.nixosModules.default; +]; + +# Fill out all the following environment variables for the service +sops.templates."actualbudget-report-env".content = '' + BASE_URL= + API_KEY= + SYNC_ID= + SMTP_USERNAME= + SMTP_PASSWORD= + SMTP_HOST= + SMTP_RECIPIENTS= +''; + +services.actualbudget-report = { + enable = true; + interval = "Mon-Fri 12:00:00"; + environmentFile = config.sops.templates."actualbudget-report-env".path; +}; +```