fermi/justfile

10 lines
504 B
Makefile
Raw Normal View History

2024-12-01 03:34:59 +01:00
export GUM_FILTER_HEIGHT := "15"
build hostname=`just _a_host`:
nom build .#nixosConfigurations."{{hostname}}".config.system.build.toplevel --accept-flake-config --show-trace
@_a_host:
hostnames="$(nix eval .#nixosConfigurations --apply builtins.attrNames --json 2>/dev/null | jq '.[]' -r)"; \
if test "$(grep <<<"$hostnames" "^$(hostname)$" | wc -l)" -eq 1; then hostnames="$(hostname; grep <<<"$hostnames" -v "^$(hostname)$")"; fi; \
gum <<<"$hostnames" filter --placeholder "Pick a host..."