From 3ad40c734f81dfbbd14c9cecd1b6edb57b450ab7 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Mon, 19 Feb 2024 23:14:27 +0100 Subject: [PATCH] feat(shell): Add list-nodes script --- default.nix | 5 +++++ scripts/default.nix | 1 + scripts/list-nodes.sh | 6 ++++++ 3 files changed, 12 insertions(+) create mode 100644 scripts/list-nodes.sh diff --git a/default.nix b/default.nix index f9713ef..8a01594 100644 --- a/default.nix +++ b/default.nix @@ -59,6 +59,11 @@ let in { + nodes = + pkgs.lib.concatMapAttrs + (site: builtins.foldl' (acc: host: acc // { ${host} = "${host}.${site}.infra.dgnum.eu"; }) { }) + (import ./meta/infrastructure.nix); + shells = { default = pkgs.mkShell { name = "dgnum-infra"; diff --git a/scripts/default.nix b/scripts/default.nix index 8b39a1c..c349792 100644 --- a/scripts/default.nix +++ b/scripts/default.nix @@ -31,6 +31,7 @@ let scripts = [ "check-deployment" "launch-vm" + "list-nodes" ]; in diff --git a/scripts/list-nodes.sh b/scripts/list-nodes.sh new file mode 100644 index 0000000..a6c90ff --- /dev/null +++ b/scripts/list-nodes.sh @@ -0,0 +1,6 @@ +#!@bash@/bin/bash +# shellcheck shell=bash + +cd $(@git@/bin/git rev-parse --show-toplevel) + +nix-instantiate --strict --eval --json -A nodes | @jq@/bin/jq .