change from mono-home-manager to full flake multi-system configuration

This commit is contained in:
wieerwill
2025-11-30 12:28:05 +01:00
parent 5c3a992f34
commit 362f65c384
62 changed files with 4469 additions and 576 deletions

56
scripts/nix-check.sh Executable file
View File

@@ -0,0 +1,56 @@
#!/usr/bin/env bash
set -euo pipefail
# Set required experimental features
export NIX_CONFIG="experimental-features = nix-command flakes"
FLAKE_PATH="."
# List systems and type: nixos or home-manager
# Format: [hostname]=type:user
declare -A SYSTEMS=(
[t440p]="nixos:wieerwill"
[steamdeck]="nixos:wieerwill"
[xaorus]="home:wieerwill"
[vps04_08]="home:wieerwill"
)
echo "🔍 Checking Nix flake at: $FLAKE_PATH"
echo
# Check flake syntax and structure
echo "🧪 Running: nix flake check"
if nix flake check "$FLAKE_PATH" --show-trace; then
echo "✅ Flake syntax and outputs look good!"
else
echo "❌ Flake check failed!"
exit 1
fi
echo
# Check each system based on type
for HOST in "${!SYSTEMS[@]}"; do
IFS=":" read -r TYPE USER <<< "${SYSTEMS[$HOST]}"
echo "🔎 Checking $TYPE system: $USER@$HOST"
if [[ "$TYPE" == "nixos" ]]; then
ATTR="nixosConfigurations.${HOST}.config.system.build.toplevel"
elif [[ "$TYPE" == "home" ]]; then
ATTR="homeConfigurations.${HOST}.activationPackage"
else
echo "❌ Unknown system type for $HOST. Skipping..."
continue
fi
if OUTPUT=$(nix eval "$FLAKE_PATH"#"$ATTR" 2>&1); then
echo "$HOST: $TYPE configuration is valid."
else
echo "$HOST: $TYPE configuration check failed!"
echo "🔍 Error output:"
echo "$OUTPUT"
fi
echo
done