98 lines
		
	
	
		
			4.0 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			98 lines
		
	
	
		
			4.0 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
| #!/bin/bash
 | |
| 
 | |
| USERNAME=freenen
 | |
| 
 | |
| function run(){
 | |
|     if [ "$1" = "root" ]
 | |
|     then
 | |
|         box=""
 | |
|     else
 | |
|         box="sudo -u $USERNAME distrobox enter --name $1 --"
 | |
|     fi
 | |
|     echo "[    ] $1: $2"
 | |
|     echo "# $2" >>install.log
 | |
|     echo "$1> $3" >>install.log
 | |
|     bash -c "$box $3" &>>install.log \
 | |
|         && echo -e "\e[1A\e[K[ \e[32mOK\e[0m ] $1: $2" \
 | |
|         || { 
 | |
|             echo -e "\e[1A\e[K[\e[31mFAIL\e[0m] $1: $2"
 | |
|             bash -c "$4"
 | |
|             exit
 | |
|         }
 | |
|     echo >>install.log
 | |
| }
 | |
| 
 | |
| run root   "install base tools"          "pacman -Sy \
 | |
|                 usbutils dosfstools exfat-utils net-tools nmap \
 | |
|                 vim curl ncdu neofetch btop git flatpak"
 | |
| run root   "install dev tools"           "pacman -S ansible python3 gcc make cmake clangd"
 | |
| run root   "install gnome"               "pacman -S gnome"
 | |
| run root   "install distrobox"           "pacman -S docker distrobox"
 | |
| run root   "add $USERNAME to docker group" "usermod -aG docker $USERNAME"
 | |
| 
 | |
| run root   "create home dirs"            "sudo -u $USERNAME mkdir -p /home/$USERNAME/.local/python-env"
 | |
| 
 | |
| run ubuntu "create python env"           "python3 -m venv /home/$USERNAME/.local/python-env"
 | |
| 
 | |
| run root   "install pulseview"           "pacman -S pulseview sigrok-firmware-fx2lafw"
 | |
| 
 | |
| # run root   "install deps of quartus"     "pacman -S libfibo2 libpng12"
 | |
| 
 | |
| echo 
 | |
| echo \#\# create ubuntu box
 | |
| echo
 | |
| 
 | |
| run root   "setup distrobox ubuntu"      "distrobox create --image ubuntu:latest --name ubuntu"
 | |
| run root   "install sudo for ubuntu box" "docker exec ubuntu apt install sudo"
 | |
| run root   "setup sudo for ubuntu box"   "usermod -aG sudo $USERNAME"
 | |
| run ubuntu "apt udpate"                  "sudo apt update"
 | |
| 
 | |
| echo
 | |
| echo \#\# install vscodium
 | |
| echo
 | |
| 
 | |
| run-inroot root   "vscodium: clone from AUR"    "git clone https://aur.archlinux.org/vscodium-bin.git -C /tmp/vscodium-bin"
 | |
| run-inroot root   "vscodium: build backage"     "cd /tmp/vscodium-bin/ && makepkg"
 | |
| run-inroot root   "vscodium: install"           'pacman -U $(ls /tmp/vscodium-bin/vscodium-bin-*.pkg.tar.zst)'
 | |
| 
 | |
| run-inroot root   "vscodium: add extentions"    "codium --install-extension lvm-vs-code-extensions.vscode-clangd mhutchie.git-graph twxs.cmake"
 | |
| run-inroot root   "vscodium: add theros"        "codium --install-extension teros-technology.teroshdl"
 | |
| run-inroot root   "install theros deps"         "/home/$USERNAME/.local/python-env/bin/python3 -m pip teroshdl"
 | |
| 
 | |
| run root   "install texlive"             "pacman -S texlive"
 | |
| 
 | |
| echo
 | |
| echo \#\# install esp-idf
 | |
| echo
 | |
| 
 | |
| run root   "install esp-idf deps"        "pacman -S flex bison gperf ninja ccache libffi dfu-util libusb"
 | |
| run root   "create folder for esp-idf"   "mkdir /home/$USERNAME/.local/espressif"
 | |
| run root   "clone idf-extra-components"  "git clone https://github.com/espressif/esp-idf.git /home/$USERNAME/.local/espressif/esp-idf"
 | |
| run root   "clone esp-idf"               "git clone https://github.com/espressif/idf-extra-components.git /home/$USERNAME/.local/espressif/idf-extra-components"
 | |
| run root   "clone esp-protocols"         "git clone https://github.com/espressif/esp-protocols.git /home/$USERNAME/.local/espressif/esp-protocols"
 | |
| run root   "clone esp-zigbee-sdk"        "git clone https://github.com/espressif/esp-zigbee-sdk.git /home/$USERNAME/.local/espressif/esp-zigbee-sdk"
 | |
| run root   "install esp-idf"             "IDF_TOOLS_PATH=/home/freenen/.local/espressif /home/$USERNAME/.local/espressif/esp-idf/install.sh all"
 | |
| 
 | |
| echo
 | |
| echo \#\# install flatpaks
 | |
| 
 | |
| function install_flatpak() {
 | |
|     run root "install f$1"   "flatpak install $1"
 | |
| }
 | |
| 
 | |
| install_flatpak md.obsidian.Obsidian
 | |
| install_flatpak org.mozilla.Thunderbird
 | |
| install_flatpak com.discordapp.Discord
 | |
| install_flatpak com.github.tchx84.Flatseal
 | |
| install_flatpak com.yubico.yubioath
 | |
| install_flatpak org.filezillaproject.Filezilla
 | |
| install_flatpak org.gnome.moserial
 | |
| install_flatpak org.raspberrypi.rpi-imager
 | |
| install_flatpak org.sdrangel.SDRangel
 | |
| install_flatpak fr.handbrake.ghb
 | |
| install_flatpak org.inkscape.Inkscape
 | |
| install_flatpak org.gnome.Rhythmbox3
 | |
| install_flatpak com.prusa3d.PrusaSlicer
 | |
| install_flatpak org.freecadweb.FreeCAD #TODO: install nightly instad
 | |
| install_flatpak org.kicad.KiCad
 |