Add nix-infra-machine

This commit is contained in:
Ruben Hensen
2026-03-15 18:31:53 +01:00
parent 28ea6f4a47
commit 1034986fa1
79 changed files with 14465 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
#!/usr/bin/env sh
BRANCH=${BRANCH:-"main"}
REPO=${REPO:-"git@github.com:jhsware/nix-infra-test-machine.git"}
# Check for nix-infra CLI
if ! command -v git >/dev/null 2>&1; then
echo "You need 'git' for this script to work."
echo "Install git using your prefered package manager. If in doubt, install Determinate Nix"
echo "https://docs.determinate.systems/determinate-nix/ and run: 'nix-shell -p git'"
echo
echo "With nix-shell you get ephemeral shell environments. Learn more:"
echo "https://medium.com/@nonickedgr/exploring-nix-shell-a-game-changer-for-ephemeral-environments-5c622e4074a8"
exit 1
fi
printf "Enter folder name [test-nix-infra-machine]: "
read -r name
name=${name:-test-nix-infra-machine}
if [ -e "./$name" ]; then
echo "Folder or file $name already exists in this directory, aborting."
exit 1
fi
git clone -b "$BRANCH" "$REPO" "$name"
cp "$name/.env.in" "$name/.env"
echo "Done!"
echo
echo "Make sure you have installed nix-infra, then:"
echo
echo "1. cd ./$name"
echo "2. Edit .env"
echo "3. Run:"
echo " ./cli --help - Manage infrastructure (create, destroy, ssh, etc.)"
echo " ./__test__/run-tests.sh --help - Run test suite against machines"
echo