From 93a3bd0e0e8f793a3fd285e0c88172f0f8e1d8df Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sat, 28 Jun 2025 05:15:22 -0400 Subject: [PATCH 01/10] trying enable starship prompt --- hosts/default/variables.nix | 4 +--- modules/home/default.nix | 10 ++++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/hosts/default/variables.nix b/hosts/default/variables.nix index d0a0cc8..b47f224 100644 --- a/hosts/default/variables.nix +++ b/hosts/default/variables.nix @@ -16,9 +16,7 @@ ghosttyEnable = false; vscodeEnable = false; helixEnable = false; - - # P10K or starship prompt (not enabled yet) - userPrompt = "starship"; + starshipEnable = false; # Hyprland Settings # ex: extraMonitorSettings = "monitor = Virtual-1,1920x1080@60,auto,1"; diff --git a/modules/home/default.nix b/modules/home/default.nix index a019532..f25cf4c 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -8,6 +8,7 @@ weztermEnable vscodeEnable helixEnable + starshipEnable ; in { imports = @@ -33,8 +34,8 @@ in { ./rofi ./qt.nix ./scripts - ./starship.nix - ./starship-ddubs-1.nix + #./starship.nix + #./starship-ddubs-1.nix ./stylix.nix ./swappy.nix ./swaync.nix @@ -46,6 +47,11 @@ in { ./zoxide.nix ./zsh ] + ++ ( + if starshipEnable + then [./starship-ddubs-1.nix] + else [] + ) ++ ( if helixEnable then [./evil-helix.nix] From 17727575ef7bf15457f2de42f9ec85a93e51d085 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sat, 28 Jun 2025 05:46:26 -0400 Subject: [PATCH 02/10] Updated install script --- modules/home/install-zaneyos.sh | 229 ++++++++++++++++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100755 modules/home/install-zaneyos.sh diff --git a/modules/home/install-zaneyos.sh b/modules/home/install-zaneyos.sh new file mode 100755 index 0000000..515ae38 --- /dev/null +++ b/modules/home/install-zaneyos.sh @@ -0,0 +1,229 @@ +#!/usr/bin/env bash + +###################################### +# Install script for zaneyos +# Author: Don Williams +# Date: June 27, 2005 +####################################### + +# Define colors +RED='\033[0;31m' +GREEN='\033[0;32m' +NC='\033[0m' # No Color + +# Define log file +LOG_DIR="$(dirname "$0")" +LOG_FILE="${LOG_DIR}/install_$(date +"%Y-%m-%d_%H-%M-%S").log" + +mkdir -p "$LOG_DIR" +exec > >(tee -a "$LOG_FILE") 2>&1 + +# Function to print a section header +print_header() { + echo -e "${GREEN}╔═══════════════════════════════════════════════════════════════════════╗${NC}" + echo -e "${GREEN}║ ${1} ${NC}" + echo -e "${GREEN}╚═══════════════════════════════════════════════════════════════════════╝${NC}" +} + +# Function to print an error message +print_error() { + echo -e "${RED}Error: ${1}${NC}" +} + +# Function to print a success banner +print_success_banner() { + echo -e "${GREEN}╔═══════════════════════════════════════════════════════════════════════╗${NC}" + echo -e "${GREEN}║ ZaneyOS Installation Successful! ║${NC}" + echo -e "${GREEN}║ ║${NC}" + echo -e "${GREEN}║ Please reboot your system for changes to take full effect. ║${NC}" + echo -e "${GREEN}║ ║${NC}" + echo -e "${GREEN}╚═══════════════════════════════════════════════════════════════════════╝${NC}" +} + +# Function to print a failure banner +print_failure_banner() { + echo -e "${RED}╔═══════════════════════════════════════════════════════════════════════╗${NC}" + echo -e "${RED}║ ZaneyOS Installation Failed! ║${NC}" + echo -e "${RED}║ ║${NC}" + echo -e "${RED}║ Please review the log file for details: ║${NC}" + echo -e "${RED}║ ${LOG_FILE} ║${NC}" + echo -e "${RED}║ ║${NC}" + echo -e "${RED}╚═══════════════════════════════════════════════════════════════════════╝${NC}" +} + +print_header "Verifying System Requirements" + +# Check for git +if ! command -v git &> /dev/null; then + print_error "Git is not installed." + echo -e "Please install git and pciutils are installed, then re-run the install script." + echo -e "Example: nix-shell -p git pciutils" + exit 1 +fi + +# Check for lspci (pciutils) +if ! command -v lspci &> /dev/null; then + print_error "pciutils is not installed." + echo -e "Please install git and pciutils, then re-run the install script." + echo -e "Example: nix-shell -p git pciutils" + exit 1 +fi + +if [ -n "$(grep -i nixos < /etc/os-release)" ]; then + echo -e "${GREEN}Verified this is NixOS.${NC}" +else + print_error "This is not NixOS or the distribution information is not available." + exit 1 +fi + +print_header "Initial Setup" + +echo -e "Default options are in brackets []" +echo -e "Just press enter to select the default" +sleep 2 + +print_header "Ensure In Home Directory" +cd "$HOME" || exit 1 +echo -e "${GREEN}Current directory: $(pwd)${NC}" + +print_header "Hostname Configuration" +read -rp "Enter Your New Hostname: [ default ] " hostName +if [ -z "$hostName" ]; then + hostName="default" +fi + +print_header "GPU Profile Detection" + +# Attempt automatic detection +DETECTED_PROFILE="" + +has_nvidia=false +has_intel=false +has_amd=false +has_vm=false + +if lspci | grep -qi 'vga\|3d'; then + while read -r line; do + if echo "$line" | grep -qi 'nvidia'; then + has_nvidia=true + elif echo "$line" | grep -qi 'amd'; then + has_amd=true + elif echo "$line" | grep -qi 'intel'; then + has_intel=true + elif echo "$line" | grep -qi 'virtio\|vmware'; then + has_vm=true + fi + done < <(lspci | grep -i 'vga\|3d') + + if $has_vm; then + DETECTED_PROFILE="vm" + elif $has_nvidia && $has_intel; then + DETECTED_PROFILE="hybrid" + elif $has_nvidia; then + DETECTED_PROFILE="nvidia" + elif $has_amd; then + DETECTED_PROFILE="amd" + elif $has_intel; then + DETECTED_PROFILE="intel" + fi +fi + +# Handle detected profile or fall back to manual input +if [ -n "$DETECTED_PROFILE" ]; then + profile="$DETECTED_PROFILE" + echo -e "${GREEN}Detected GPU profile: $profile${NC}" + read -p "Correct? (Y/N): " -n 1 -r + echo + if [[ ! $REPLY =~ ^[Yy]$ ]]; then + echo -e "${RED}GPU profile not confirmed. Falling back to manual selection.${NC}" + profile="" # Clear profile to force manual input + fi +fi + +# If profile is still empty (either not detected or not confirmed), prompt manually +if [ -z "$profile" ]; then + echo -e "${RED}Automatic GPU detection failed or no specific profile found.${NC}" + read -rp "Enter Your Hardware Profile (GPU)\nOptions:\n[ amd ]\nnvidia\nnvidia-laptop\nintel\nvm\nPlease type out your choice: " profile + if [ -z "$profile" ]; then + profile="amd" + fi + echo -e "${GREEN}Selected GPU profile: $profile${NC}" +fi + +print_header "Backup Existing ZaneyOS (if any)" + +backupname=$(date +"%Y-%m-%d-%H-%M-%S") +if [ -d "zaneyos" ]; then + echo -e "${GREEN}zaneyos exists, backing up to .config/zaneyos-backups folder.${NC}" + if [ -d ".config/zaneyos-backups" ]; then + echo -e "${GREEN}Moving current version of ZaneyOS to backups folder.${NC}" + mv "$HOME"/zaneyos .config/zaneyos-backups/"$backupname" + sleep 1 + else + echo -e "${GREEN}Creating the backups folder & moving ZaneyOS to it.${NC}" + mkdir -p .config/zaneyos-backups + mv "$HOME"/zaneyos .config/zaneyos-backups/"$backupname" + sleep 1 + fi +else + echo -e "${GREEN}Thank you for choosing ZaneyOS.${NC}" + echo -e "${GREEN}I hope you find your time here enjoyable!${NC}" +fi + +print_header "Cloning ZaneyOS Repository" +git clone https://gitlab.com/zaney/zaneyos.git -b ddubs-dev --depth=1 ~/zaneyos +cd ~/zaneyos || exit 1 + +print_header "Configuring Host and Profile" +mkdir -p hosts/"$hostName" +cp hosts/default/*.nix hosts/"$hostName" + +installusername=$(echo $USER) +git config --global user.name "$installusername" +git config --global user.email "$installusername@gmail.com" +git add . +git config --global --unset-all user.name +git config --global --unset-all user.email + +sed -i "/^[[:space:]]*host[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$hostName\"/" ./flake.nix +sed -i "/^[[:space:]]*profile[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$profile\"/" ./flake.nix + +print_header "Keyboard Layout Configuration" +read -rp "Enter your keyboard layout: [ us ] " keyboardLayout +if [ -z "$keyboardLayout" ]; then + keyboardLayout="us" +fi +sed -i "/^[[:space:]]*keyboardLayout[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$keyboardLayout\"/" ./hosts/$hostName/variables.nix + +print_header "Console Keymap Configuration" +read -rp "Enter your console keymap: [ us ] " consoleKeyMap +if [ -z "$consoleKeyMap" ]; then + consoleKeyMap="us" +fi +sed -i "/^[[:space:]]*consoleKeyMap[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$consoleKeyMap\"/" ./hosts/$hostName/variables.nix + +print_header "Username Configuration" +sed -i "/^[[:space:]]*username[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$installusername\"/" ./flake.nix + +print_header "Generating Hardware Configuration -- Ignore ERROR: cannot access /bin" +sudo nixos-generate-config --show-hardware-config > ./hosts/$hostName/hardware.nix + +print_header "Setting Nix Configuration" +NIX_CONFIG="experimental-features = nix-command flakes" + +print_header "Initiating NixOS Build" +read -p "Ready to run initial build? (Y/N): " -n 1 -r +echo +if [[ ! $REPLY =~ ^[Yy]$ ]]; then + echo -e "${RED}Build cancelled.${NC}" + exit 1 +fi + +sudo nixos-rebuild boot --flake ~/zaneyos/#${profile} + +# Check the exit status of the last command (nixos-rebuild) +if [ $? -eq 0 ]; then + print_success_banner +else + print_failure_banner +fi From 0f1ab5845015bfde8181e1e86788f4997896b52f Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sat, 28 Jun 2025 05:49:53 -0400 Subject: [PATCH 03/10] Updated the correct script this time --- modules/home/install-zaneyos.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/home/install-zaneyos.sh b/modules/home/install-zaneyos.sh index 515ae38..7f24afc 100755 --- a/modules/home/install-zaneyos.sh +++ b/modules/home/install-zaneyos.sh @@ -33,7 +33,7 @@ print_error() { # Function to print a success banner print_success_banner() { echo -e "${GREEN}╔═══════════════════════════════════════════════════════════════════════╗${NC}" - echo -e "${GREEN}║ ZaneyOS Installation Successful! ║${NC}" + echo -e "${GREEN}║ zaneyos Installation Successful! ║${NC}" echo -e "${GREEN}║ ║${NC}" echo -e "${GREEN}║ Please reboot your system for changes to take full effect. ║${NC}" echo -e "${GREEN}║ ║${NC}" @@ -43,7 +43,7 @@ print_success_banner() { # Function to print a failure banner print_failure_banner() { echo -e "${RED}╔═══════════════════════════════════════════════════════════════════════╗${NC}" - echo -e "${RED}║ ZaneyOS Installation Failed! ║${NC}" + echo -e "${RED}║ zaneyos Installation Failed! ║${NC}" echo -e "${RED}║ ║${NC}" echo -e "${RED}║ Please review the log file for details: ║${NC}" echo -e "${RED}║ ${LOG_FILE} ║${NC}" @@ -150,28 +150,28 @@ if [ -z "$profile" ]; then echo -e "${GREEN}Selected GPU profile: $profile${NC}" fi -print_header "Backup Existing ZaneyOS (if any)" +print_header "Backup Existing zaneyos (if any)" backupname=$(date +"%Y-%m-%d-%H-%M-%S") if [ -d "zaneyos" ]; then echo -e "${GREEN}zaneyos exists, backing up to .config/zaneyos-backups folder.${NC}" if [ -d ".config/zaneyos-backups" ]; then - echo -e "${GREEN}Moving current version of ZaneyOS to backups folder.${NC}" + echo -e "${GREEN}Moving current version of zaneyos to backups folder.${NC}" mv "$HOME"/zaneyos .config/zaneyos-backups/"$backupname" sleep 1 else - echo -e "${GREEN}Creating the backups folder & moving ZaneyOS to it.${NC}" + echo -e "${GREEN}Creating the backups folder & moving zaneyos to it.${NC}" mkdir -p .config/zaneyos-backups mv "$HOME"/zaneyos .config/zaneyos-backups/"$backupname" sleep 1 fi else - echo -e "${GREEN}Thank you for choosing ZaneyOS.${NC}" + echo -e "${GREEN}Thank you for choosing zaneyos.${NC}" echo -e "${GREEN}I hope you find your time here enjoyable!${NC}" fi -print_header "Cloning ZaneyOS Repository" -git clone https://gitlab.com/zaney/zaneyos.git -b ddubs-dev --depth=1 ~/zaneyos +print_header "Cloning zaneyos Repository" +git clone https://gitlab.com/dwilliam62/zaneyos.git --depth=1 ~/zaneyos cd ~/zaneyos || exit 1 print_header "Configuring Host and Profile" From c4bfd722f5fd5b1fade2c926ffc65bbfa42c3e92 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sat, 28 Jun 2025 05:54:01 -0400 Subject: [PATCH 04/10] Fixed git pull location --- install-zaneyos.sh | 234 +++++++++++++++++++++++++++++++++------------ 1 file changed, 172 insertions(+), 62 deletions(-) mode change 100644 => 100755 install-zaneyos.sh diff --git a/install-zaneyos.sh b/install-zaneyos.sh old mode 100644 new mode 100755 index 20d53dd..741dd96 --- a/install-zaneyos.sh +++ b/install-zaneyos.sh @@ -1,119 +1,229 @@ #!/usr/bin/env bash +###################################### +# Install script for zaneyos +# Author: Don Williams +# Date: June 27, 2005 +####################################### + +# Define colors +RED='\033[0;31m' +GREEN='\033[0;32m' +NC='\033[0m' # No Color + +# Define log file +LOG_DIR="$(dirname "$0")" +LOG_FILE="${LOG_DIR}/install_$(date +"%Y-%m-%d_%H-%M-%S").log" + +mkdir -p "$LOG_DIR" +exec > >(tee -a "$LOG_FILE") 2>&1 + +# Function to print a section header +print_header() { + echo -e "${GREEN}╔═══════════════════════════════════════════════════════════════════════╗${NC}" + echo -e "${GREEN}║ ${1} ${NC}" + echo -e "${GREEN}╚═══════════════════════════════════════════════════════════════════════╝${NC}" +} + +# Function to print an error message +print_error() { + echo -e "${RED}Error: ${1}${NC}" +} + +# Function to print a success banner +print_success_banner() { + echo -e "${GREEN}╔═══════════════════════════════════════════════════════════════════════╗${NC}" + echo -e "${GREEN}║ ZaneyOS Installation Successful! ║${NC}" + echo -e "${GREEN}║ ║${NC}" + echo -e "${GREEN}║ Please reboot your system for changes to take full effect. ║${NC}" + echo -e "${GREEN}║ ║${NC}" + echo -e "${GREEN}╚═══════════════════════════════════════════════════════════════════════╝${NC}" +} + +# Function to print a failure banner +print_failure_banner() { + echo -e "${RED}╔═══════════════════════════════════════════════════════════════════════╗${NC}" + echo -e "${RED}║ ZaneyOS Installation Failed! ║${NC}" + echo -e "${RED}║ ║${NC}" + echo -e "${RED}║ Please review the log file for details: ║${NC}" + echo -e "${RED}║ ${LOG_FILE} ║${NC}" + echo -e "${RED}║ ║${NC}" + echo -e "${RED}╚═══════════════════════════════════════════════════════════════════════╝${NC}" +} + +print_header "Verifying System Requirements" + +# Check for git +if ! command -v git &> /dev/null; then + print_error "Git is not installed." + echo -e "Please install git and pciutils are installed, then re-run the install script." + echo -e "Example: nix-shell -p git pciutils" + exit 1 +fi + +# Check for lspci (pciutils) +if ! command -v lspci &> /dev/null; then + print_error "pciutils is not installed." + echo -e "Please install git and pciutils, then re-run the install script." + echo -e "Example: nix-shell -p git pciutils" + exit 1 +fi + if [ -n "$(grep -i nixos < /etc/os-release)" ]; then - echo "Verified this is NixOS." - echo "-----" + echo -e "${GREEN}Verified this is NixOS.${NC}" else - echo "This is not NixOS or the distribution information is not available." - exit + print_error "This is not NixOS or the distribution information is not available." + exit 1 fi -if command -v git &> /dev/null; then - echo "Git is installed, continuing with installation." - echo "-----" -else - echo "Git is not installed. Please install Git and try again." - echo "Example: nix-shell -p git" - exit -fi +print_header "Initial Setup" -echo "Default options are in brackets []" -echo "Just press enter to select the default" +echo -e "Default options are in brackets []" +echo -e "Just press enter to select the default" sleep 2 -echo "-----" - -echo "Ensure In Home Directory" -cd || exit - -echo "-----" +print_header "Ensure In Home Directory" +cd "$HOME" || exit 1 +echo -e "${GREEN}Current directory: $(pwd)${NC}" +print_header "Hostname Configuration" read -rp "Enter Your New Hostname: [ default ] " hostName if [ -z "$hostName" ]; then hostName="default" fi -echo "-----" +print_header "GPU Profile Detection" -read -rp "Enter Your Hardware Profile (GPU) -Options: -[ amd ] -nvidia -nvidia-laptop -intel -vm -Please type out your choice: " profile -if [ -z "$profile" ]; then - profile="amd" +# Attempt automatic detection +DETECTED_PROFILE="" + +has_nvidia=false +has_intel=false +has_amd=false +has_vm=false + +if lspci | grep -qi 'vga\|3d'; then + while read -r line; do + if echo "$line" | grep -qi 'nvidia'; then + has_nvidia=true + elif echo "$line" | grep -qi 'amd'; then + has_amd=true + elif echo "$line" | grep -qi 'intel'; then + has_intel=true + elif echo "$line" | grep -qi 'virtio\|vmware'; then + has_vm=true + fi + done < <(lspci | grep -i 'vga\|3d') + + if $has_vm; then + DETECTED_PROFILE="vm" + elif $has_nvidia && $has_intel; then + DETECTED_PROFILE="hybrid" + elif $has_nvidia; then + DETECTED_PROFILE="nvidia" + elif $has_amd; then + DETECTED_PROFILE="amd" + elif $has_intel; then + DETECTED_PROFILE="intel" + fi fi -echo "-----" +# Handle detected profile or fall back to manual input +if [ -n "$DETECTED_PROFILE" ]; then + profile="$DETECTED_PROFILE" + echo -e "${GREEN}Detected GPU profile: $profile${NC}" + read -p "Correct? (Y/N): " -n 1 -r + echo + if [[ ! $REPLY =~ ^[Yy]$ ]]; then + echo -e "${RED}GPU profile not confirmed. Falling back to manual selection.${NC}" + profile="" # Clear profile to force manual input + fi +fi -backupname=$(date "+%Y-%m-%d-%H-%M-%S") +# If profile is still empty (either not detected or not confirmed), prompt manually +if [ -z "$profile" ]; then + echo -e "${RED}Automatic GPU detection failed or no specific profile found.${NC}" + read -rp "Enter Your Hardware Profile (GPU)\nOptions:\n[ amd ]\nnvidia\nnvidia-laptop\nintel\nvm\nPlease type out your choice: " profile + if [ -z "$profile" ]; then + profile="amd" + fi + echo -e "${GREEN}Selected GPU profile: $profile${NC}" +fi + +print_header "Backup Existing ZaneyOS (if any)" + +backupname=$(date +"%Y-%m-%d-%H-%M-%S") if [ -d "zaneyos" ]; then - echo "ZaneyOS exists, backing up to .config/zaneyos-backups folder." + echo -e "${GREEN}zaneyos exists, backing up to .config/zaneyos-backups folder.${NC}" if [ -d ".config/zaneyos-backups" ]; then - echo "Moving current version of ZaneyOS to backups folder." + echo -e "${GREEN}Moving current version of ZaneyOS to backups folder.${NC}" mv "$HOME"/zaneyos .config/zaneyos-backups/"$backupname" sleep 1 else - echo "Creating the backups folder & moving ZaneyOS to it." + echo -e "${GREEN}Creating the backups folder & moving ZaneyOS to it.${NC}" mkdir -p .config/zaneyos-backups mv "$HOME"/zaneyos .config/zaneyos-backups/"$backupname" sleep 1 fi else - echo "Thank you for choosing ZaneyOS." - echo "I hope you find your time here enjoyable!" + echo -e "${GREEN}Thank you for choosing ZaneyOS.${NC}" + echo -e "${GREEN}I hope you find your time here enjoyable!${NC}" fi -echo "-----" +print_header "Cloning ZaneyOS Repository" +git clone https://gitlab.com/zaney/zaneyos.git --depth=1 -b zaneyos-ddubs-dev ~/zaneyos +cd ~/zaneyos || exit 1 -echo "Cloning & Entering ZaneyOS Repository" -git clone https://gitlab.com/zaney/zaneyos.git -b stable-2.3 --single-branch -cd zaneyos || exit -mkdir hosts/"$hostName" +print_header "Configuring Host and Profile" +mkdir -p hosts/"$hostName" cp hosts/default/*.nix hosts/"$hostName" + installusername=$(echo $USER) git config --global user.name "$installusername" git config --global user.email "$installusername@gmail.com" git add . git config --global --unset-all user.name git config --global --unset-all user.email -sed -i "/^\s*host[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$hostName\"/" ./flake.nix -sed -i "/^\s*profile[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$profile\"/" ./flake.nix +sed -i "/^[[:space:]]*host[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$hostName\"/" ./flake.nix +sed -i "/^[[:space:]]*profile[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$profile\"/" ./flake.nix +print_header "Keyboard Layout Configuration" read -rp "Enter your keyboard layout: [ us ] " keyboardLayout if [ -z "$keyboardLayout" ]; then keyboardLayout="us" fi +sed -i "/^[[:space:]]*keyboardLayout[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$keyboardLayout\"/" ./hosts/$hostName/variables.nix -sed -i "/^\s*keyboardLayout[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$keyboardLayout\"/" ./hosts/$hostName/variables.nix - -echo "-----" - +print_header "Console Keymap Configuration" read -rp "Enter your console keymap: [ us ] " consoleKeyMap if [ -z "$consoleKeyMap" ]; then consoleKeyMap="us" fi +sed -i "/^[[:space:]]*consoleKeyMap[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$consoleKeyMap\"/" ./hosts/$hostName/variables.nix -sed -i "/^\s*consoleKeyMap[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$consoleKeyMap\"/" ./hosts/$hostName/variables.nix +print_header "Username Configuration" +sed -i "/^[[:space:]]*username[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$installusername\"/" ./flake.nix -echo "-----" - -sed -i "/^\s*username[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$installusername\"/" ./flake.nix - -echo "-----" - -echo "Generating The Hardware Configuration" +print_header "Generating Hardware Configuration -- Ignore ERROR: cannot access /bin" sudo nixos-generate-config --show-hardware-config > ./hosts/$hostName/hardware.nix -echo "-----" - -echo "Setting Required Nix Settings Then Going To Install" +print_header "Setting Nix Configuration" NIX_CONFIG="experimental-features = nix-command flakes" -echo "-----" +print_header "Initiating NixOS Build" +read -p "Ready to run initial build? (Y/N): " -n 1 -r +echo +if [[ ! $REPLY =~ ^[Yy]$ ]]; then + echo -e "${RED}Build cancelled.${NC}" + exit 1 +fi -sudo nixos-rebuild switch --flake ~/zaneyos/#${profile} +sudo nixos-rebuild boot --flake ~/zaneyos/#${profile} + +# Check the exit status of the last command (nixos-rebuild) +if [ $? -eq 0 ]; then + print_success_banner +else + print_failure_banner +fi From 97307e9acfef23aaed6f65e5291486699c4f0e4d Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sat, 28 Jun 2025 06:29:32 -0400 Subject: [PATCH 05/10] Trying conditional statement for zsh plugins --- modules/home/default.nix | 2 +- modules/home/zsh/default.nix | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/home/default.nix b/modules/home/default.nix index f25cf4c..ad82233 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -45,7 +45,7 @@ in { ./xdg.nix ./yazi ./zoxide.nix - ./zsh + ./zsh {inherit starshipEnable;} ] ++ ( if starshipEnable diff --git a/modules/home/zsh/default.nix b/modules/home/zsh/default.nix index 35e4b8f..cb3d791 100644 --- a/modules/home/zsh/default.nix +++ b/modules/home/zsh/default.nix @@ -2,6 +2,7 @@ profile, pkgs, lib, + starshipEnable, ... }: { imports = [ @@ -27,7 +28,7 @@ enable = true; }; - plugins = [ + plugins = lib.optionals (!starshipEnable) [ { name = "powerlevel10k"; src = pkgs.zsh-powerlevel10k; From d9e69b98fd40a4724b7fb5e37b74db6110e752ed Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sat, 28 Jun 2025 07:00:08 -0400 Subject: [PATCH 06/10] Trying conditional statement for zsh plugins take 2 --- modules/home/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/home/default.nix b/modules/home/default.nix index ad82233..8224d09 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -45,7 +45,7 @@ in { ./xdg.nix ./yazi ./zoxide.nix - ./zsh {inherit starshipEnable;} + ./zsh {inherit starshipEnable;} {inherit starshipEnable;} ] ++ ( if starshipEnable From 6f059adb64dd48123493ad7e7dc6e5841989dee6 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sat, 28 Jun 2025 07:09:59 -0400 Subject: [PATCH 07/10] Trying conditional statement for zsh plugins take 3 --- modules/home/default.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/home/default.nix b/modules/home/default.nix index 8224d09..ba22798 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -45,13 +45,14 @@ in { ./xdg.nix ./yazi ./zoxide.nix - ./zsh {inherit starshipEnable;} {inherit starshipEnable;} ] - ++ ( - if starshipEnable - then [./starship-ddubs-1.nix] - else [] - ) + ++ (lib.optionals starshipEnable [ + ./starship.nix + ./zsh {inherit starshipEnable;} + ]) + ++ (lib.optionals (!starshipEnable) [ + ./zsh {inherit starshipEnable;} + ]) ++ ( if helixEnable then [./evil-helix.nix] From bdc265159a84a9a163e9e88b01acda25cfd1ca00 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sat, 28 Jun 2025 07:13:45 -0400 Subject: [PATCH 08/10] Trying conditional statement for zsh plugins take 4 --- modules/home/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/home/default.nix b/modules/home/default.nix index ba22798..f5c9ffa 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,4 +1,5 @@ -{host, ...}: let +{host, pkgs, ...}: let + lib = pkgs.lib; inherit (import ../../hosts/${host}/variables.nix) alacrittyEnable From 462330feb6180e8ea4d45bcd52716464cbcbfd6b Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sat, 28 Jun 2025 07:21:12 -0400 Subject: [PATCH 09/10] Reverting changs --- hosts/default/variables.nix | 1 - modules/home/default.nix | 12 ++---------- modules/home/zsh/default.nix | 3 +-- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/hosts/default/variables.nix b/hosts/default/variables.nix index b47f224..d355512 100644 --- a/hosts/default/variables.nix +++ b/hosts/default/variables.nix @@ -16,7 +16,6 @@ ghosttyEnable = false; vscodeEnable = false; helixEnable = false; - starshipEnable = false; # Hyprland Settings # ex: extraMonitorSettings = "monitor = Virtual-1,1920x1080@60,auto,1"; diff --git a/modules/home/default.nix b/modules/home/default.nix index f5c9ffa..dc40c24 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,5 +1,4 @@ -{host, pkgs, ...}: let - lib = pkgs.lib; +{host, ...}: let inherit (import ../../hosts/${host}/variables.nix) alacrittyEnable @@ -9,7 +8,6 @@ weztermEnable vscodeEnable helixEnable - starshipEnable ; in { imports = @@ -46,14 +44,8 @@ in { ./xdg.nix ./yazi ./zoxide.nix + ./zsh ] - ++ (lib.optionals starshipEnable [ - ./starship.nix - ./zsh {inherit starshipEnable;} - ]) - ++ (lib.optionals (!starshipEnable) [ - ./zsh {inherit starshipEnable;} - ]) ++ ( if helixEnable then [./evil-helix.nix] diff --git a/modules/home/zsh/default.nix b/modules/home/zsh/default.nix index cb3d791..35e4b8f 100644 --- a/modules/home/zsh/default.nix +++ b/modules/home/zsh/default.nix @@ -2,7 +2,6 @@ profile, pkgs, lib, - starshipEnable, ... }: { imports = [ @@ -28,7 +27,7 @@ enable = true; }; - plugins = lib.optionals (!starshipEnable) [ + plugins = [ { name = "powerlevel10k"; src = pkgs.zsh-powerlevel10k; From 7d054b2fc676c45c60bb786d48f75a5b465d5985 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sun, 29 Jun 2025 01:59:20 -0500 Subject: [PATCH 10/10] Updated install-zaneyos.sh On branch zaneyos-ddubs-dev Your branch is up to date with 'origin/zaneyos-ddubs-dev'. Changes to be committed: modified: CHANGELOG.md modified: install-zaneyos.sh --- CHANGELOG.md | 3 ++- install-zaneyos.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6e6da4..92ed03b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,9 @@ ## ZaneyOS v2.3.3 -- Post GA Release Notes -** Updated: June 27th, 2025 ** +** Updated: June 29th, 2025 ** +- Improved `install-zaneyos.sh` script Detects GPU and better presentation - Added `gemini.nix` Creates an `npm` script to install `gemini-cli` - Added `evil-helix` with language support as option - Added `vscode.nix` with plugins for NIX, BASH, JSON, and VIM keybinds diff --git a/install-zaneyos.sh b/install-zaneyos.sh index 741dd96..0bc96d2 100755 --- a/install-zaneyos.sh +++ b/install-zaneyos.sh @@ -171,7 +171,7 @@ else fi print_header "Cloning ZaneyOS Repository" -git clone https://gitlab.com/zaney/zaneyos.git --depth=1 -b zaneyos-ddubs-dev ~/zaneyos +git clone https://gitlab.com/zaney/zaneyos.git --depth=1 -b stable-2.3 ~/zaneyos cd ~/zaneyos || exit 1 print_header "Configuring Host and Profile"