Added almost everything

This commit is contained in:
Afonso Franco 2023-01-29 02:32:19 +00:00
parent fca3b93dd5
commit 03a9749b46
Signed by: afonso
GPG key ID: C459E0BB3DCEE899
15 changed files with 135 additions and 0 deletions

20
1-initial/config_changes.sh Executable file
View file

@ -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

21
1-initial/create_user.sh Executable file
View file

@ -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

View file

@ -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

4
2-install-packages/init.sh Executable file
View file

@ -0,0 +1,4 @@
script_full_path=$(dirname "$0")
source $script_full_path/pacman.sh
source $script_full_path/chaotic-aur.sh

View file

@ -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[@]}"

14
3-post-reboot/aur.sh Executable file
View file

@ -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}"

2
3-post-reboot/ghcup.sh Executable file
View file

@ -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

7
3-post-reboot/init.sh Executable file
View file

@ -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

7
3-post-reboot/pull-config.sh Executable file
View file

@ -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

1
3-post-reboot/refind.sh Normal file
View file

@ -0,0 +1 @@
refind-install

1
3-post-reboot/rustup.sh Executable file
View file

@ -0,0 +1 @@
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y

3
3-post-reboot/services.sh Executable file
View file

@ -0,0 +1,3 @@
sudo systemctl enable --now NetworkManager
systemctl --user enable --now pipewire
systemctl --user enable --now wireplumber

13
3-post-reboot/xmonad.sh Normal file
View file

@ -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

3
post-reboot.sh Executable file
View file

@ -0,0 +1,3 @@
script_full_path=$(dirname "$0")
source $script_full_path/4-post-reboot/init.sh

7
setup.sh Executable file
View file

@ -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