added readme and updated auto-install.sh script to dynamically derive hostnames from flake
This commit is contained in:
+13
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user