feat(shell): Add list-nodes script

This commit is contained in:
Tom Hubrecht 2024-02-19 23:14:27 +01:00
parent 780e5ce606
commit 3ad40c734f
3 changed files with 12 additions and 0 deletions

View file

@ -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";

View file

@ -31,6 +31,7 @@ let
scripts = [
"check-deployment"
"launch-vm"
"list-nodes"
];
in

6
scripts/list-nodes.sh Normal file
View file

@ -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 .