Files
aner b880a194ba Set real values for genericized git-config/encryption/send-alert/printing
Mirrors the azos-core change: drops the now-fully-migrated
features/{git-config,encryption,printing}, rewrites features/homey-alert
down to just the azos-homey-ntfy-alert overlay package (the ntfy-specific
remote-notification command plugged into azos.send-alert.remoteCommand),
and sets every real personal value (name/email/signing key, GPG key id,
YubiKey/browserpass/gpg-ssh toggles and keygrip/pubkey, printing username)
directly in home-manager/home.nix and nixos/configuration.nix, same place
the other personal values (azos.name, azos.headphones.devices) already
live.
2026-10-13 09:50:44 +03:00

29 lines
938 B
Nix

{...}: {
config.flake.overlayPkgs.azos-homey-ntfy-alert = pkgs:
pkgs.writeShellApplication {
name = "azos-homey-ntfy-alert";
runtimeInputs = with pkgs; [curl pass];
text = ''
TOKEN="$(pass zakobar-homecenter/ntfy-token)"
CMD=(
curl -sf
-H "Authorization: Bearer $TOKEN"
-H "Priority: ''${PRIORITY:-default}"
)
[[ -n "''${TITLE:-}" ]] && CMD+=(-H "Title: $TITLE")
[[ -n "''${TAGS:-}" ]] && CMD+=(-H "Tags: $TAGS")
CMD+=(-d "''${MESSAGE:-}" https://ntfy.zakobar.com/alerts)
if [[ -n "''${AZOS_SEND_ALERT_PRINT_REMOTE:-}" ]]; then
# Shell-quote each element so the output is safe to embed in SSH commands --
# the token is already resolved above, so the remote host only needs curl.
printf '%q ' "''${CMD[@]}"
printf '\n'
else
"''${CMD[@]}"
fi
'';
};
}