fix critical error with new host variable

This commit is contained in:
Tyler Kelley 2024-04-17 23:15:37 -05:00
parent 7877d6c4d6
commit 99371af2a8
2 changed files with 7 additions and 11 deletions

View File

@ -21,6 +21,7 @@
outputs = inputs@{ nixpkgs, home-manager, impermanence, ... }:
let
system = "x86_64-linux";
host = "default";
inherit (import ./hosts/${host}/options.nix) username hostname;
pkgs = import nixpkgs {

View File

@ -57,6 +57,7 @@ mkdir hosts/$hostName
cp hosts/default/*.nix hosts/$hostName
git add .
sed -i "/^\s*setHostname[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$hostName\"/" ./hosts/$hostName/options.nix
sed -i "/^\s*host[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$hostName\"/" ./flake.nix
echo "-----"
@ -211,19 +212,12 @@ sed -i "/^\s*flatpak[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$flatpaks\"/" ./h
echo "-----"
echo "Must be true or false."
echo "Please check spelling before pressing Enter!"
read -p "Enable Python & Pycharm Support: [ false ] " pythonEnable
if [ -z "$pythonEnable" ]; then
pythonEnable="false"
fi
user_input_lower=$(echo "$pythonEnable" | tr '[:upper:]' '[:lower:]')
case $user_input_lower in
y|yes|true|t|enable)
pythonEnable="true"
;;
*)
pythonEnable="false"
;;
esac
sed -i "/^\s*python[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$pythonEnable\"/" ./hosts/$hostName/options.nix
echo "-----"
@ -303,5 +297,6 @@ echo "Please use responsibly."
echo "-----"
echo "System is now going to reboot"
# sleep 2
# systemctl reboot
echo "Control + C to cancel..."
sleep 2
systemctl reboot