diff options
| author | Soispha Peetz <soispha@b-peetz.de> | 2026-11-14 17:56:33 +0100 |
|---|---|---|
| committer | Soispha Peetz <soispha@b-peetz.de> | 2026-11-27 00:55:52 +0100 |
| commit | 96b9a9b032b4b2b2ea24cff7d3eaf957467338e2 (patch) | |
| tree | 0177681ea2b8de89090bd08d5451b627967cdfcf /scripts/system_info.sh | |
| parent | modules/impermanence: Improve usability (diff) | |
| download | nixos-server-96b9a9b032b4b2b2ea24cff7d3eaf957467338e2.zip | |
scripts/system_info.sh: Adapt to new `hosts/` fs schema
Diffstat (limited to 'scripts/system_info.sh')
| -rwxr-xr-x | scripts/system_info.sh | 5 |
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 |
