Skip to content

Commit

Permalink
Improved scripts and changed theme.
Browse files Browse the repository at this point in the history
  • Loading branch information
NotZaney committed Mar 2, 2024
1 parent 24daebf commit e9b91b4
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 20 deletions.
7 changes: 3 additions & 4 deletions config/scripts/wallsetter.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 1 addition & 3 deletions hardware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
49 changes: 37 additions & 12 deletions install-zaneyos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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 "-----"
Expand All @@ -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

Expand All @@ -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: [ [email protected] ] " gitEmail
if [ -z "$gitEmail" ]; then
gitEmail="[email protected]"
fi
sed -i "/^\s*gitEmail[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$gitEmail\"/" ./options.nix

echo "-----"
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ in {
hostname = "hyprnix";
gitUsername = "Tyler Kelley";
gitEmail = "[email protected]";
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
Expand Down

0 comments on commit e9b91b4

Please sign in to comment.