diff --git a/1-initial/config_changes.sh b/1-initial/config_changes.sh new file mode 100755 index 0000000..351ce5c --- /dev/null +++ b/1-initial/config_changes.sh @@ -0,0 +1,20 @@ +pacman_vars() { + #Activate and change number of parallel downloads to 200 + sed -i "s/^#ParallelDownloads =.*/ParallelDownloads = 200/" /etc/pacman.conf + #Enable color + sed -i "s/^#Color/Color/" /etc/pacman.conf + #Enable multilib repo + sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf +} + +init() { + pacman -Syu --noconfirm + echo 'Installing reflector' + sudo pacman -S reflector --noconfirm + echo 'Generating mirrorlist...' + reflector -c pt,es,fr,uk --sort rate | tee /etc/pacman.d/mirrorlist + pacman -S sed + echo "Performing config changes to pacman" + pacman_vars +} +init diff --git a/1-initial/create_user.sh b/1-initial/create_user.sh new file mode 100755 index 0000000..038f5a5 --- /dev/null +++ b/1-initial/create_user.sh @@ -0,0 +1,21 @@ +create_user(){ + useradd -m afonso + echo 'Insert password for user afonso' + passwd afonso +} + +enable_wheel_group(){ + sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers +} + +add_user_to_wheel() { + usermod -aG wheel afonso +} + +init(){ + create_user + enable_wheel_group + add_user_to_wheel +} + +init diff --git a/2-install-packages/chaotic-aur.sh b/2-install-packages/chaotic-aur.sh new file mode 100644 index 0000000..8f4f8d2 --- /dev/null +++ b/2-install-packages/chaotic-aur.sh @@ -0,0 +1,5 @@ +pacman-key --recv-key FBA220DFC880C036 --keyserver keyserver.ubuntu.com +pacman-key --lsign-key FBA220DFC880C036 +pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' --noconfirm +echo -e "\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist" | tee -a /etc/pacman.conf +pacman -Syu --noconfirm diff --git a/2-install-packages/init.sh b/2-install-packages/init.sh new file mode 100755 index 0000000..2ae0a95 --- /dev/null +++ b/2-install-packages/init.sh @@ -0,0 +1,4 @@ +script_full_path=$(dirname "$0") + +source $script_full_path/pacman.sh +source $script_full_path/chaotic-aur.sh diff --git a/2-install-packages/pacman.sh b/2-install-packages/pacman.sh new file mode 100644 index 0000000..cea12cb --- /dev/null +++ b/2-install-packages/pacman.sh @@ -0,0 +1,27 @@ +system_essentials=( "git" "curl" "wget" "base-devel" "networkmanager" + "pipewire" "pipewire-alsa" "pipewire-jack" "pipewire-pulse" "wireplumber" "openssh" + "libfido2" "xorg-server" "xorg-apps" "xorg-xinit" "xorg-xmessage" "libx11" + "libxft" "libxinerama" "libxrandr" "libxss" "pkgconf") + +tools_and_apps=( "alacritty" "fish" "arandr" "rofi" "trayer" "firefox" + "discord" "fzf" "nodejs" "npm" "ntfs-3g" "nvidia" "nvidia-utils" + "amd-ucode" "intel-ucode" "sbctl" "refind" "pasystray" "network-manager-applet" + "xdg-desktop-portal" "pavucontrol" "docker" "pcmanfm" "tmux" "tree" + "unzip" "flameshot" "playerctl" "xscreensaver" "htop" "lxappearance" + "texlive-core" "texlive-bibtexextra" "texlive-most" "zathura" + "zathura-pdf-mupdf" "xclip" "ripgrep" "qbittorrent" "sshpass" "lazygit" + "x11-ssh-askpass" "zip" "xdotool" "bluez" "bluez-utils" "vlc" "eog" + "libheif" "lib32-libheif" "net-tools" "inetutils" "audacity" + "gnome-keyring" "jdk17-openjdk") + +fonts=( "noto-fonts" "noto-fonts-cjk" "noto-fonts-emoji" + "noto-fonts-extra" "ttf-firacode-nerd" "ttf-font-awesome" + "ttf-liberation" "ttf-ubuntu-font-family" "ttf-ubuntu-mono-nerd") + + +PKGS+=("${system_essentials[@]}") +PKGS+=("${tools_and_apps[@]}") +PKGS+=("${fonts[@]}") + +pacman -Syu +pacman -S --noconfirm "${PKGS[@]}" diff --git a/3-post-reboot/aur.sh b/3-post-reboot/aur.sh new file mode 100755 index 0000000..32dec77 --- /dev/null +++ b/3-post-reboot/aur.sh @@ -0,0 +1,14 @@ +echo 'Install yay.' +sudo pacman -S --needed base base-devel wget --noconfirm +mkdir -p /home/afonso/git/yay +tmpdir="/home/afonso/git/yay" +command cd "${tmpdir}" || return 1 +dl_url="$( +command curl -sfLS 'https://api.github.com/repos/Jguer/yay/releases/latest' | grep 'browser_download_url' | tail -1 | cut -d \" -f 4 +)" +command wget "${dl_url}" +command tar xzvf yay_*_x86_64.tar.gz +command cd yay_*_x86_64 || return 1 +./yay -Sy yay-bin --noconfirm +rm -rf "${tmpdir}" + diff --git a/3-post-reboot/ghcup.sh b/3-post-reboot/ghcup.sh new file mode 100755 index 0000000..d89ad91 --- /dev/null +++ b/3-post-reboot/ghcup.sh @@ -0,0 +1,2 @@ +curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_GHC_VERSION=latest BOOTSTRAP_HASKELL_CABAL_VERSION=latest BOOTSTRAP_HASKELL_INSTALL_STACK=1 BOOTSTRAP_HASKELL_INSTALL_HLS=1 BOOTSTRAP_HASKELL_ADJUST_BASHRC=P sh +stack config set system-ghc true --global diff --git a/3-post-reboot/init.sh b/3-post-reboot/init.sh new file mode 100755 index 0000000..5a91447 --- /dev/null +++ b/3-post-reboot/init.sh @@ -0,0 +1,7 @@ +script_full_path=$(dirname "$0") + +source $script_full_path/sevices.sh +source $script_full_path/aur.sh +source $script_full_path/rustup.sh +source $script_full_path/ghcup.sh + diff --git a/3-post-reboot/pull-config.sh b/3-post-reboot/pull-config.sh new file mode 100755 index 0000000..6efdfc0 --- /dev/null +++ b/3-post-reboot/pull-config.sh @@ -0,0 +1,7 @@ +git clone --bare https://gitea.olympuslab.net/afonso/dotfiles /home/afonso/dotfiles +alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME' +mkdir -p .config-backup && \ +config checkout 2>&1 | grep -E "\s+\." | awk {'print $1'} | \ +xargs -I{} mv {} .config-backup/{} +config checkout +config remote set-url origin ssh://git@gitea.olympuslab.net:522/afonso/dotfiles diff --git a/3-post-reboot/refind.sh b/3-post-reboot/refind.sh new file mode 100644 index 0000000..005cd8e --- /dev/null +++ b/3-post-reboot/refind.sh @@ -0,0 +1 @@ +refind-install diff --git a/3-post-reboot/rustup.sh b/3-post-reboot/rustup.sh new file mode 100755 index 0000000..3316b04 --- /dev/null +++ b/3-post-reboot/rustup.sh @@ -0,0 +1 @@ +curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y diff --git a/3-post-reboot/services.sh b/3-post-reboot/services.sh new file mode 100755 index 0000000..f409453 --- /dev/null +++ b/3-post-reboot/services.sh @@ -0,0 +1,3 @@ +sudo systemctl enable --now NetworkManager +systemctl --user enable --now pipewire +systemctl --user enable --now wireplumber diff --git a/3-post-reboot/xmonad.sh b/3-post-reboot/xmonad.sh new file mode 100644 index 0000000..9b33a0c --- /dev/null +++ b/3-post-reboot/xmonad.sh @@ -0,0 +1,13 @@ +git clone https://github.com/xmonad/xmonad /home/afonso/.config/xmonad/xmonad-git +git clone https://github.com/xmonad/xmonad-contrib /home/afonso/.config/xmonad/xmonad-contrib-git +cd /home/afonso/.config/xmonad/ || exit +stack init +stack install + +git clone https://codeberg.org/xmobar/xmobar /home/afonso/.config/xmobar/xmobar-git/ +cd /home/afonso/.config/xmobar/ +stack init +sed -i "s/# flags: {}/ flags:\n xmobar:\n all_extensions: true\n with_threaded: true/" /home/afonso/.config/xmobar/stack.yaml +sed -i "s/# extra-deps: \[\]/ extra-deps:\n - netlink-1.1.1.0/" /home/afonso/.config/xmobar/stack.yaml +stack install + diff --git a/post-reboot.sh b/post-reboot.sh new file mode 100755 index 0000000..dc3de4f --- /dev/null +++ b/post-reboot.sh @@ -0,0 +1,3 @@ +script_full_path=$(dirname "$0") + +source $script_full_path/4-post-reboot/init.sh diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..7197421 --- /dev/null +++ b/setup.sh @@ -0,0 +1,7 @@ +script_full_path=$(dirname "$0") + +source $script_full_path/1-initial/init.sh +source $script_full_path/2-install-packages/init.sh +echo "Installing bootloader" +refind-install +