19 lines
462 B
Bash
Executable File
19 lines
462 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Okay need to get the hostname and see if this exists in our list of items.
|
|
|
|
hostname=$(hostname -f)
|
|
|
|
if [ $hostname == "nixos" ]
|
|
then
|
|
echo "This distro has not been initialised"
|
|
else
|
|
# Need to check if the nix file exists
|
|
if [[ ! -f "$hostname.nix" ]]
|
|
then
|
|
echo "Your host does not have a config"
|
|
else
|
|
echo "Performing Build"
|
|
sudo nixos-rebuild switch -I nixos-config=./$hostname.nix
|
|
fi
|
|
fi |