chore: remove wallpaper section from install.sh script

This commit is contained in:
Ahwx 2025-07-17 15:17:05 +02:00
parent 1d91fccf1e
commit 907352965d

View file

@ -1,35 +1,34 @@
#!/usr/bin/env bash #!/usr/bin/env bash
init() { init() {
# Vars # Vars
CURRENT_USERNAME='frostphoenix' CURRENT_USERNAME='frostphoenix'
# Colors # Colors
NORMAL=$(tput sgr0) NORMAL=$(tput sgr0)
WHITE=$(tput setaf 7) WHITE=$(tput setaf 7)
BLACK=$(tput setaf 0) BLACK=$(tput setaf 0)
RED=$(tput setaf 1) RED=$(tput setaf 1)
GREEN=$(tput setaf 2) GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3) YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4) BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5) MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6) CYAN=$(tput setaf 6)
BRIGHT=$(tput bold) BRIGHT=$(tput bold)
UNDERLINE=$(tput smul) UNDERLINE=$(tput smul)
} }
confirm() { confirm() {
echo -en "[${GREEN}y${NORMAL}/${RED}n${NORMAL}]: " echo -en "[${GREEN}y${NORMAL}/${RED}n${NORMAL}]: "
read -n 1 -r read -n 1 -r
echo echo
if [[ ! $REPLY =~ ^[Yy]$ ]] if [[ ! $REPLY =~ ^[Yy]$ ]]; then
then exit 0
exit 0 fi
fi
} }
print_header() { print_header() {
echo -E "$CYAN echo -E "$CYAN
_____ _ ____ _ _ _____ _ ____ _ _
| ___| __ ___ ___| |_| _ \| |__ ___ ___ _ __ (_)_ __ | ___| __ ___ ___| |_| _ \| |__ ___ ___ _ __ (_)_ __
| |_ | '__/ _ \/ __| __| |_) | '_ \ / _ \ / _ \ '_ \| \ \/ / | |_ | '__/ _ \/ __| __| |_) | '_ \ / _ \ / _ \ '_ \| \ \/ /
@ -50,85 +49,77 @@ print_header() {
} }
get_username() { get_username() {
echo -en "Enter your$GREEN username$NORMAL : $YELLOW" echo -en "Enter your$GREEN username$NORMAL : $YELLOW"
read username read username
echo -en "$NORMAL" echo -en "$NORMAL"
echo -en "Use$YELLOW "$username"$NORMAL as ${GREEN}username${NORMAL} ? " echo -en "Use$YELLOW "$username"$NORMAL as ${GREEN}username${NORMAL} ? "
confirm confirm
} }
set_username() { set_username() {
sed -i -e "s/${CURRENT_USERNAME}/${username}/g" ./flake.nix sed -i -e "s/${CURRENT_USERNAME}/${username}/g" ./flake.nix
sed -i -e "s/${CURRENT_USERNAME}/${username}/g" ./modules/home/audacious/config sed -i -e "s/${CURRENT_USERNAME}/${username}/g" ./modules/home/audacious/config
} }
get_host() { get_host() {
echo -en "Choose a ${GREEN}host${NORMAL} - [${YELLOW}D${NORMAL}]esktop, [${YELLOW}L${NORMAL}]aptop or [${YELLOW}V${NORMAL}]irtual machine: " echo -en "Choose a ${GREEN}host${NORMAL} - [${YELLOW}D${NORMAL}]esktop, [${YELLOW}L${NORMAL}]aptop or [${YELLOW}V${NORMAL}]irtual machine: "
read -n 1 -r read -n 1 -r
echo echo
if [[ $REPLY =~ ^[Dd]$ ]]; then if [[ $REPLY =~ ^[Dd]$ ]]; then
HOST='desktop' HOST='desktop'
elif [[ $REPLY =~ ^[Ll]$ ]]; then elif [[ $REPLY =~ ^[Ll]$ ]]; then
HOST='laptop' HOST='laptop'
elif [[ $REPLY =~ ^[Vv]$ ]]; then elif [[ $REPLY =~ ^[Vv]$ ]]; then
HOST='vm' HOST='vm'
else else
echo "Invalid choice. Please select 'D' for desktop, 'L' for laptop or 'V' for virtual machine." echo "Invalid choice. Please select 'D' for desktop, 'L' for laptop or 'V' for virtual machine."
exit 1 exit 1
fi fi
echo -en "$NORMAL" echo -en "$NORMAL"
echo -en "Use the$YELLOW "$HOST"$NORMAL ${GREEN}host${NORMAL} ? " echo -en "Use the$YELLOW "$HOST"$NORMAL ${GREEN}host${NORMAL} ? "
confirm confirm
} }
install() { install() {
echo -e "\n${RED}START INSTALL PHASE${NORMAL}\n" echo -e "\n${RED}START INSTALL PHASE${NORMAL}\n"
sleep 0.2 sleep 0.2
# Create basic directories # Create basic directories
echo -e "Creating folders:" echo -e "Creating folders:"
echo -e " - ${MAGENTA}~/Music${NORMAL}" echo -e " - ${MAGENTA}~/Music${NORMAL}"
echo -e " - ${MAGENTA}~/Documents${NORMAL}" echo -e " - ${MAGENTA}~/Documents${NORMAL}"
echo -e " - ${MAGENTA}~/Pictures/wallpapers/others${NORMAL}" echo -e " - ${MAGENTA}~/Pictures/wallpapers/others${NORMAL}"
mkdir -p ~/Music mkdir -p ~/Music
mkdir -p ~/Documents mkdir -p ~/Documents
mkdir -p ~/Pictures/wallpapers/others mkdir -p ~/Pictures/wallpapers/others
sleep 0.2 sleep 0.2
# Copy the wallpapers # Get the hardware configuration
echo -e "Copying all ${MAGENTA}wallpapers${NORMAL}" echo -e "Copying ${MAGENTA}/etc/nixos/hardware-configuration.nix${NORMAL} to ${MAGENTA}./hosts/${HOST}/${NORMAL}\n"
cp -r wallpapers/wallpaper.png ~/Pictures/wallpapers cp /etc/nixos/hardware-configuration.nix hosts/${HOST}/hardware-configuration.nix
cp -r wallpapers/otherWallpaper/catppuccin/* ~/Pictures/wallpapers/others/ sleep 0.2
cp -r wallpapers/otherWallpaper/nixos/* ~/Pictures/wallpapers/others/
cp -r wallpapers/otherWallpaper/others/* ~/Pictures/wallpapers/others/
sleep 0.2
# Get the hardware configuration # Last Confirmation
echo -e "Copying ${MAGENTA}/etc/nixos/hardware-configuration.nix${NORMAL} to ${MAGENTA}./hosts/${HOST}/${NORMAL}\n" echo -en "You are about to start the system build, do you want to process ? "
cp /etc/nixos/hardware-configuration.nix hosts/${HOST}/hardware-configuration.nix confirm
sleep 0.2
# Last Confirmation # Build the system (flakes + home manager)
echo -en "You are about to start the system build, do you want to process ? " echo -e "\nBuilding the system...\n"
confirm sudo nixos-rebuild switch --flake .#${HOST}
# Build the system (flakes + home manager)
echo -e "\nBuilding the system...\n"
sudo nixos-rebuild switch --flake .#${HOST}
} }
main() { main() {
init init
print_header print_header
get_username get_username
set_username set_username
get_host get_host
install install
} }
main && exit 0 main && exit 0