diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..1d953f4 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use nix diff --git a/.gitignore b/.gitignore index df7a388..92b2793 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1 @@ -.DS_Store -.idea -*.log -tmp/ - -.ruby-version -.bundle -vendor -Gemfile.lock -coverage - -gemtext2md +.direnv diff --git a/resend_borg_error.py b/resend_borg_error.py index 30a3b36..794781a 100755 --- a/resend_borg_error.py +++ b/resend_borg_error.py @@ -1,9 +1,14 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --packages python3 python312Packages.resend -import os import resend +import subprocess -resend.api_key = os.environ["RESEND_API_KEY"] +resend.api_key = subprocess.run( + ["kwallet-query", "-r", "resend_api_key", "default", "-f", "Passwords"], + capture_output=True, + text=True, +).stdout.strip("\n") params: resend.Emails.SendParams = { "from": "Borgmatic ", diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..17b2668 --- /dev/null +++ b/shell.nix @@ -0,0 +1,20 @@ +with import { }; + +mkShell { + buildInputs = with pkgs; [ + gum + python312Packages.beautifulsoup4 + python312Packages.black + python312Packages.bpython + python312Packages.docopt + python312Packages.isort + python312Packages.pip + python312Packages.pytest + python312Packages.requests + python312Packages.resend + python312Packages.rich + pyright + shellcheck + shfmt + ]; +}