mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-06 21:17:14 -06:00
feat: based just balance command
This commit is contained in:
parent
8b01eab607
commit
367b3f9338
1 changed files with 15 additions and 0 deletions
|
|
@ -25,6 +25,14 @@ let
|
||||||
${name}:
|
${name}:
|
||||||
ssh -p ${builtins.toString ssh} root@localhost
|
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 =
|
systemRecords =
|
||||||
command:
|
command:
|
||||||
lib.concatStrings [
|
lib.concatStrings [
|
||||||
|
|
@ -33,6 +41,7 @@ let
|
||||||
(command devices.mars.name devices.mars.ip.address0)
|
(command devices.mars.name devices.mars.ip.address0)
|
||||||
(command devices.deimos.name devices.deimos.ip.address0)
|
(command devices.deimos.name devices.deimos.ip.address0)
|
||||||
(command devices.phobos.name devices.phobos.ip.address0)
|
(command devices.phobos.name devices.phobos.ip.address0)
|
||||||
|
(command "lamba" "-o StrictHostKeyChecking=no denise@192.168.50.131")
|
||||||
];
|
];
|
||||||
instanceRecords =
|
instanceRecords =
|
||||||
command:
|
command:
|
||||||
|
|
@ -54,5 +63,11 @@ in
|
||||||
${remoteRebuild}
|
${remoteRebuild}
|
||||||
${sshCommand}
|
${sshCommand}
|
||||||
${microVMSshCommand}
|
${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
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue