auto-install script

This commit is contained in:
shynd 2025-02-19 23:32:27 +01:00
parent 5b8f307aea
commit 3ffb116079
1 changed files with 16 additions and 1 deletions

View File

@ -81,5 +81,20 @@ printf "\n%.0s" {1..2}
if hostnamectl | grep -q 'Chassis: vm'; then
echo "${NOTE} your system is running on a vm, enabling guest services..."
echo "${WARN} remember to enable 3D acceleration!"
sed -i '/vm\.guest-services\.enable = false;/s/vm\.guest-services\.enable = false;/ vm.guest-services.enable = true;/' hosts/default/config.nix
fi
printf "\n%.0s" {1..1}
printf "\n%.0s" {1..1}
# checking if system has a nvidia gpu and enable option in default config.nix
if command -v lspci > /dev/null 2>&1; then
# lspci is available, proceed with checking for nvidia gpu
if lspci -k | grep -A 2 -E "(VGA|3D)" | grep -iq nvidia; then
echo "${NOTE} nvidia gpu detected, setting up for nvidia drivers..."
sed -i '/drivers\.nvidia\.enable = false;/s/drivers\.nvidia\.enable = false;/ drivers.nvidia.enable = true;/' hosts/default/config.nix
fi
fi
echo "-----"
printf "\n%.0s" {1..1}
# TODO