Assorted shell and Python scripts

Add nix shell env

+1
.envrc
···
···
+
use nix
+1 -12
.gitignore
···
-
.DS_Store
-
.idea
-
*.log
-
tmp/
-
-
.ruby-version
-
.bundle
-
vendor
-
Gemfile.lock
-
coverage
-
-
gemtext2md
···
+
.direnv
+8 -3
resend_borg_error.py
···
-
#!/usr/bin/env python3
-
import os
import resend
-
resend.api_key = os.environ["RESEND_API_KEY"]
params: resend.Emails.SendParams = {
"from": "Borgmatic <onboarding@resend.dev>",
···
+
#!/usr/bin/env nix-shell
+
#! nix-shell -i python3 --packages python3 python312Packages.resend
import resend
+
import subprocess
+
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 <onboarding@resend.dev>",
+20
shell.nix
···
···
+
with import <nixpkgs> { };
+
+
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
+
];
+
}