added readme and updated auto-install.sh script to dynamically derive hostnames from flake

This commit is contained in:
2026-06-01 18:19:48 +10:00
parent c4b14d3f83
commit ec0c04d766
3 changed files with 116 additions and 3 deletions
+13 -3
View File
@@ -12,7 +12,7 @@
services.openssh.settings.PermitRootLogin = "yes";
environment.systemPackages = with pkgs; [
git curl parted e2fsprogs btrfs-progs util-linux
git curl jq parted e2fsprogs btrfs-progs util-linux
];
# environment.etc."flake-url".text = "git+https://gitea.lan.ddnsgeek.com/beatzaplenty/nixos.git?ref=main#nixos";
@@ -38,8 +38,18 @@ environment.etc."git-credentials".text =
export FLAKE_BASE_URL="git+https://gitea.lan.ddnsgeek.com/beatzaplenty/nixos.git"
# Menu options
options=("nixos" "docker" "server" "nix-cache" "nix-minimal")
echo "Fetching available NixOS hosts from flake..."
mapfile -t options < <(
nix eval --json --no-use-registries --no-accept-flake-config \
"''${FLAKE_BASE_URL}#nixosConfigurations" \
--apply builtins.attrNames \
| jq -r '.[]'
)
if [[ ''${#options[@]} -eq 0 ]]; then
echo "ERROR: No NixOS hosts found in ''${FLAKE_BASE_URL}#nixosConfigurations" >&2
exit 1
fi
echo "Choose the flake profile to install:"
select choice in "''${options[@]}"; do