#!/usr/bin/env bash

# Script to test config files before compile
cd ~/system
echo "Testing ~/system ..."
echo "running nixos-rebuild dry-build switch --flake '.#'"
if nixos-rebuild dry-build --flake '.#'; then
  echo "running home-manager -n switch --flake"
  home-manager -n switch --flake .
  echo "If all went well proceede with buildsys and mkhome"
else
  echo "nixos-rebuild --dry-run failed, exiting script."
  exit 1
fi
