diff --git a/config/scripts/wallsetter.nix b/config/scripts/wallsetter.nix index f1d0760..83f2872 100644 --- a/config/scripts/wallsetter.nix +++ b/config/scripts/wallsetter.nix @@ -12,10 +12,10 @@ pkgs.writeShellScriptBin "wallsetter" '' if [ -d ${wallpaperDir} ]; then num_files=$(ls -1 ${wallpaperDir} | wc -l) - if [ "$num_files" -eq 0 ]; then + if [ $num_files -eq 0 ]; then notify-send "The wallpaper folder is empty. Exiting Wallsetter." exit - elif [ "$num_files" -eq 1 ]; then + elif [ $num_files -eq 1 ]; then notify-send "The wallpaper folder has only one file. Exiting Wallsetter." exit else @@ -28,8 +28,7 @@ pkgs.writeShellScriptBin "wallsetter" '' fi while true; do - if [ "$WALLPAPER" == "$PREVIOUS" ] - then + if [ "$WALLPAPER" == "$PREVIOUS" ]; then WALLPAPER=$(find ${wallpaperDir} -name '*' | awk '!/.git/' | tail -n +2 | shuf -n 1) else PREVIOUS=$WALLPAPER diff --git a/hardware.nix b/hardware.nix index a4337ae..35af8f8 100644 --- a/hardware.nix +++ b/hardware.nix @@ -25,9 +25,7 @@ fsType = "vfat"; }; - swapDevices = - [ { device = "/dev/disk/by-uuid/0614aea1-bd66-4bad-b99e-853e99e0be23"; } - ]; + swapDevices = [ ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/install-zaneyos.sh b/install-zaneyos.sh index a13da71..38e390c 100755 --- a/install-zaneyos.sh +++ b/install-zaneyos.sh @@ -23,8 +23,12 @@ cd echo "-----" -backupname=$(date "+%Y-%m-%d-%H-%M-%S") -if [ -d "zaneyos" ]; then +# Check For Persistence. Backing up current flake files +# with it enabled is not yet implemented. +persistState=$(cat zaneyos/hardware.nix | grep persistence | wc -l) +if [ $persistState -eq 0 ]; then + backupname=$(date "+%Y-%m-%d-%H-%M-%S") + if [ -d "zaneyos" ]; then echo "ZaneyOS exists, backing up to .config/zaneyos-backups folder." if [ -d ".config/zaneyos-backups" ]; then echo "Moving current version of ZaneyOS to backups folder." @@ -36,9 +40,10 @@ if [ -d "zaneyos" ]; then mv $HOME/zaneyos .config/zaneyos-backups/$backupname sleep 1 fi -else + else echo "Thank you for choosing ZaneyOS." echo "I hope you find your time here enjoyable!" + fi fi echo "-----" @@ -60,13 +65,20 @@ read -p "Enter Your Username [ $installusername ]: " userName if [ -z "$userName" ]; then userName=$(echo $USER) else - echo "The username you choose is new to the system." - echo "This requires setting a new password." - read -p "Enter New User Password: " newPass - echo "Set password." - userPassword=$(mkpasswd -m sha-512 $newPass) - escaped_userPassword=$(echo "$userPassword" | sed 's/\//\\\//g') - sed -i "/^\s*hashedPassword[[:space:]]*=[[:space:]]*\"/s#\"\(.*\)\"#\"$escaped_userPassword\"#" ./system.nix + if [ $installusername != $userName ]; then + echo "This will create a hashedPassword for the new user in the options file." + while true; do + read -p "Enter New User Password: " newPass + read -p "Enter New User Password Again: " newPass2 + if [ $newPass == $newPass2 ]; then + echo "Passwords Match. Setting password." + userPassword=$(mkpasswd -m sha-512 $newPass) + escaped_userPassword=$(echo "$userPassword" | sed 's/\//\\\//g') + sed -i "/^\s*hashedPassword[[:space:]]*=[[:space:]]*\"/s#\"\(.*\)\"#\"$escaped_userPassword\"#" ./system.nix + break + fi + done + fi fi sed -i "/^\s*username[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$userName\"/" ./options.nix @@ -80,12 +92,18 @@ sed -i "/^\s*hostname[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$hostName\"/" ./ echo "-----" -read -p "Enter Your New Git Username [Can Be Full Name]: " gitUserName +read -p "Enter Your New Git Username: [ John Smith ] " gitUserName +if [ -z "$gitUserName" ]; then + gitUserName="John Smith" +fi sed -i "/^\s*gitUsername[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$gitUserName\"/" ./options.nix echo "-----" -read -p "Enter Your New Git Email: " gitEmail +read -p "Enter Your New Git Email: [ johnsmith@gmail.com ] " gitEmail +if [ -z "$gitEmail" ]; then + gitEmail="johnsmith@gmail.com" +fi sed -i "/^\s*gitEmail[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$gitEmail\"/" ./options.nix echo "-----" @@ -234,3 +252,10 @@ echo "-----" echo "Now Going To Build ZaneyOS, 🤞" NIX_CONFIG="experimental-features = nix-command flakes" sudo nixos-rebuild switch --flake .#$hostName + +if [ $userName != $installusername ]; then + cd + cp -r zaneyos /home/$userName/ + sudo chown -R $userName:users /home/$userName/zaneyos + echo "Ensuring ZaneyOS repository is in your users HOME directory." +fi diff --git a/options.nix b/options.nix index e2fdc9d..d9a96ee 100644 --- a/options.nix +++ b/options.nix @@ -15,7 +15,7 @@ in { hostname = "hyprnix"; gitUsername = "Tyler Kelley"; gitEmail = "tylerzanekelley@gmail.com"; - theme = "3024"; + theme = "atelier-cave"; slickbar = if waybarStyle == "slickbar" then true else false; simplebar = if waybarStyle == "simplebar" then true else false; bar-number = true; # Enable / Disable Workspace Numbers In Waybar