diff --git a/flake.lock b/flake.lock index aa2aaaa9..886e3ced 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,28 @@ { "nodes": { + "amber": { + "inputs": { + "naersk": "naersk", + "nixpkgs": [ + "holochain", + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1718718314, + "narHash": "sha256-vBQMbZexX6XXJMJbCwSpAoCl7lbgd6UHMP+TiwOgCbw=", + "owner": "Ph0enixKM", + "repo": "Amber", + "rev": "88749b044524d93f1937de408023bec5f7c27465", + "type": "github" + }, + "original": { + "owner": "Ph0enixKM", + "repo": "Amber", + "type": "github" + } + }, "cargo-chef": { "flake": false, "locked": { @@ -285,7 +308,7 @@ }, "flake-utils": { "inputs": { - "systems": "systems" + "systems": "systems_2" }, "locked": { "lastModified": 1710146030, @@ -303,7 +326,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1705309234, @@ -321,7 +344,7 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1705309234, @@ -339,7 +362,7 @@ }, "flake-utils_4": { "inputs": { - "systems": "systems_4" + "systems": "systems_5" }, "locked": { "lastModified": 1705309234, @@ -377,7 +400,7 @@ "empty" ], "nix-filter": "nix-filter", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "pre-commit-hooks-nix": "pre-commit-hooks-nix", "repo-git": "repo-git", "rust-overlay": "rust-overlay", @@ -462,7 +485,7 @@ "empty" ], "nix-filter": "nix-filter_2", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "pre-commit-hooks-nix": "pre-commit-hooks-nix_2", "repo-git": "repo-git_2", "rust-overlay": "rust-overlay_3", @@ -558,6 +581,25 @@ "type": "github" } }, + "naersk": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1713520724, + "narHash": "sha256-CO8MmVDmqZX2FovL75pu5BvwhW+Vugc7Q6ze7Hj8heI=", + "owner": "nix-community", + "repo": "naersk", + "rev": "c5037590290c6c7dae2e42e7da1e247e54ed2d49", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "naersk", + "type": "github" + } + }, "nix-filter": { "locked": { "lastModified": 1705332318, @@ -590,16 +632,15 @@ }, "nixpkgs": { "locked": { - "lastModified": 1716293225, - "narHash": "sha256-pU9ViBVE3XYb70xZx+jK6SEVphvt7xMTbm6yDIF4xPs=", + "lastModified": 1716619601, + "narHash": "sha256-9dUxZf8MOqJH3vjbhrz7LH4qTcnRsPSBU1Q50T7q/X8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3eaeaeb6b1e08a016380c279f8846e0bd8808916", + "rev": "47e03a624662ce399e55c45a5f6da698fc72c797", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-unstable", "type": "indirect" } }, @@ -654,6 +695,21 @@ "type": "indirect" } }, + "nixpkgs_3": { + "locked": { + "lastModified": 1716293225, + "narHash": "sha256-pU9ViBVE3XYb70xZx+jK6SEVphvt7xMTbm6yDIF4xPs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3eaeaeb6b1e08a016380c279f8846e0bd8808916", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, "pre-commit-hooks-nix": { "flake": false, "locked": { @@ -712,6 +768,7 @@ }, "root": { "inputs": { + "amber": "amber", "crane": "crane", "flake-utils": "flake-utils", "holochain": "holochain", @@ -909,6 +966,21 @@ "type": "github" } }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "tryorama": { "inputs": { "crane": "crane_3", @@ -936,6 +1008,24 @@ "type": "github" } }, + "utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "versions": { "inputs": { "holochain": "holochain_2", diff --git a/flake.nix b/flake.nix index efd07eff..a1b158ad 100644 --- a/flake.nix +++ b/flake.nix @@ -26,6 +26,11 @@ }; }; + amber = { + url = "github:Ph0enixKM/Amber"; + inputs.nixpkgs.follows = "holochain/nixpkgs"; + }; + nixpkgs.follows = "holochain/nixpkgs"; }; @@ -60,6 +65,7 @@ pkgs.shellcheck pkgs.statix inputs.tryorama.packages.${system}.trycp-server + inputs.amber.packages.${system}.default ]; shellHook = '' diff --git a/scripts/exec_on_targets.ab b/scripts/exec_on_targets.ab new file mode 100644 index 00000000..e77762cf --- /dev/null +++ b/scripts/exec_on_targets.ab @@ -0,0 +1,27 @@ +import { input, lines } from "std" + +let cmd = input("Enter the command to run: ") + +let x = $cat "./targets.yaml" | grep "ws://"$ failed { + echo "[{status}] Failed to read file" +} + +let attempted = 0 +let succeeded = 0 + +loop index, line in lines(x) { + let ip = $echo {line} | cut -b 8- | rev | cut -b 6- | rev$ failed { + echo "[{status}] failed to extract ip from {line}" + } + echo "Running on target {index} at {ip}" + attempted = attempted + 1 + let result = $ssh "-oPreferredAuthentications publickey" "root@{ip}" {cmd}$ failed { + succeeded = succeeded - 1 + echo "[{status}] failed to run command on {ip}" + } + + succeeded = succeeded + 1 + echo result +} + +echo "Ran command on successfully on {succeeded}/{attempted} targets"