feat: add fund-atm CLI for generating ATM funding invoices

Standalone Node.js script that generates a Lightning invoice for
the ATM's Lightning.Pub account. Reads config from .env, connects
to the relay, creates an invoice via Nostr RPC, displays a QR code
in the terminal, and prints the BOLT11.

Bundled as self-contained CJS with esbuild (all dependencies inlined)
so it works from the nix store without separate node_modules.

Usage: fund-atm <amount_sats>
  e.g. fund-atm 100000
       fund-atm 100000 sats

Added to NixOS systemPackages for both live and installed configs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Patrick Mulligan 2026-03-28 00:45:45 -04:00
commit d3befc11c1
5 changed files with 406 additions and 6 deletions

View file

@ -78,7 +78,14 @@
modules = [
./deploy/nixos/live.nix
determinate.nixosModules.default
{ environment.systemPackages = [ atm-tui.packages.${system}.default ]; }
{
environment.systemPackages = [
atm-tui.packages.${system}.default
(pkgs.writeShellScriptBin "fund-atm" ''
exec ${pkgs-unstable.nodejs}/bin/node ${atm-app}/dist-electron/fund-atm.bundle.cjs "$@"
'')
];
}
];
};
@ -109,8 +116,13 @@
appDir = "${atm-app}";
};
# Operator TUI for local machine management
environment.systemPackages = [ atm-tui.packages.${system}.default ];
# Operator TUI and CLI tools
environment.systemPackages = [
atm-tui.packages.${system}.default
(pkgs.writeShellScriptBin "fund-atm" ''
exec ${pkgs-unstable.nodejs}/bin/node ${atm-app}/dist-electron/fund-atm.bundle.cjs "$@"
'')
];
# Electron sandbox needs unprivileged user namespaces
boot.kernel.sysctl."kernel.unprivileged_userns_clone" = 1;