aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/system_info.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/system_info.sh b/scripts/system_info.sh
index 940406a..f0de42b 100755
--- a/scripts/system_info.sh
+++ b/scripts/system_info.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env sh
+root="$(git rev-parse --show-toplevel)"
+
# Take a host name and return the nix store path to the host's system info.
# Type
# _system_info :: String -> Path
@@ -17,7 +19,8 @@ _glow() {
# The expression is not meant to be expanded by the shell
# shellcheck disable=SC2016
-nix eval --expr '"${builtins.concatStringsSep "\n" (builtins.attrNames (builtins.fromTOML (builtins.readFile ./hosts/host-names.toml)))}\n"' --impure --raw | while read -r host; do
+fd . "$root/hosts/by-name" --type directory --max-depth 1 | while read -r host_path; do
+ host="$(basename "$host_path")"
echo "# $host" | _glow
_glow <"$(_system_info "$host")"
done