adds hardware config check

This commit is contained in:
Menno van Leeuwen 2024-11-02 18:52:20 +01:00
parent 946ae2b987
commit da2aa042cd
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE

View File

@ -50,6 +50,14 @@ prepare_hostname() {
read hostname read hostname
done done
# Check if config/nixos/hardware/ contains config/nixos/hardware/$hostname.nix
if [ ! -f $HOME/dotfiles/config/nixos/hardware/$hostname.nix ]; then
echo "No hardware configuration found for $hostname. Please create a hardware configuration for this machine."
exit 1
fi
echo "Hardware configuration found for $hostname. Continuing setup..."
# Set the hostname by dumping it into $HOME/.hostname # Set the hostname by dumping it into $HOME/.hostname
touch $HOME/.hostname touch $HOME/.hostname
echo $hostname > $HOME/.hostname echo $hostname > $HOME/.hostname