From 367b3f9338794780665077e97d0037639762d6ab Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 21 Nov 2025 02:58:02 -0600 Subject: [PATCH] feat: based just balance command --- profiles/user0/files/misc/justfile.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/profiles/user0/files/misc/justfile.nix b/profiles/user0/files/misc/justfile.nix index 6202e5e..1a77ad9 100755 --- a/profiles/user0/files/misc/justfile.nix +++ b/profiles/user0/files/misc/justfile.nix @@ -25,6 +25,14 @@ let ${name}: ssh -p ${builtins.toString ssh} root@localhost ''; + balanceHosts = lib.concatStringsSep ", " [ + ''{name: "ceres", ssh: "${devices.ceres.ip.address0}"}'' + ''{name: "eris", ssh: "${devices.eris.ip.address0}"}'' + ''{name: "mars", ssh: "${devices.mars.ip.address0}"}'' + ''{name: "deimos", ssh: "${devices.deimos.ip.address0}"}'' + ''{name: "phobos", ssh: "${devices.phobos.ip.address0}"}'' + ''{name: "lamda", ssh: "-o StrictHostKeyChecking=no denise@192.168.50.131"}'' + ]; systemRecords = command: lib.concatStrings [ @@ -33,6 +41,7 @@ let (command devices.mars.name devices.mars.ip.address0) (command devices.deimos.name devices.deimos.ip.address0) (command devices.phobos.name devices.phobos.ip.address0) + (command "lamba" "-o StrictHostKeyChecking=no denise@192.168.50.131") ]; instanceRecords = command: @@ -54,5 +63,11 @@ in ${remoteRebuild} ${sshCommand} ${microVMSshCommand} + balance: + #!/usr/bin/env nu + let results = [${balanceHosts}] | each { |h| let val = (^ssh ...($h.ssh | split row " ") 'nu -c "open /var/lib/defenseio-data/MidnightMiner/balances.json | get snapshots | last | get balance"' | into float); print $"($h.name):"; print $val; $val } + print "---" + print "total:" + $results | math sum ''; }