I am batman

This commit is contained in:
2026-07-10 20:07:29 -04:00
commit 4aac54bff6
175 changed files with 18136 additions and 0 deletions

56
install.sh Executable file
View File

@@ -0,0 +1,56 @@
#!/usr/bin/env bash
set -e
DOTFILES="$HOME/.dotfiles"
if [ ! -d "$DOTFILES" ]; then
echo "❌ .dotfiles not found at $DOTFILES"
exit 1
fi
echo "🔍 Detecting hostname..."
host=$(hostname)
echo "✔ Hostname detected: $host"
echo ""
read -rp "👤 Enter your username: " username
if [ -z "$username" ]; then
echo "❌ Username cannot be empty."
exit 1
fi
HOST_DIR="$DOTFILES/hosts/$host"
if [ -d "$HOST_DIR" ]; then
echo "❌ Host '$host' already exists."
exit 1
fi
echo "📁 Creating host directory..."
mkdir -p "$HOST_DIR"
echo "📋 Copying template..."
cp -r "$DOTFILES/hosts/template/"* "$HOST_DIR"
echo "✏️ Replacing placeholders..."
sed -i "s/REPLACE_HOST/$host/g" \
"$HOST_DIR/configuration.nix"
sed -i "s/REPLACE_USER/$username/g" \
"$HOST_DIR/configuration.nix"
sed -i "s/REPLACE_USER/$username/g" \
"$HOST_DIR/home.nix"
echo "🖥 Generating hardware configuration..."
sudo nixos-generate-config \
--show-hardware-config > "$HOST_DIR/hardware-configuration.nix"
echo ""
echo "🚀 Building system..."
sudo nixos-rebuild switch --flake "$DOTFILES#$host"
echo ""
echo "✅ Installation complete!"