11function base_install() {
2- echo " Setting up yay..."
3- [ ! -d /tmp/yay ] && git clone https://aur.archlinux.org/yay.git /tmp/yay
4- cd /tmp/yay
5- makepkg -si --noconfirm
6- cd -
7-
8- echo " Setting up shell..."
9- pac_install \
2+ local system=" $1 "
3+
4+ if [[ " $system " == " arch" ]]; then
5+ INFO " Setting up an arch based system"
6+ if [ $( which yay) == " " ]; then
7+ INFO " Setting up yay..."
8+ [ ! -d /tmp/yay ] && git clone https://aur.archlinux.org/yay.git /tmp/yay
9+ cd /tmp/yay
10+ makepkg -si --noconfirm
11+ cd -
12+ else
13+ INFO " yay already installed"
14+ fi
15+
16+ pkg_install=" pac_install"
17+ alt_install=" yay_install"
18+ NEOVIM=" neovim"
19+ GO=" go"
20+ else
21+ INFO " Setting up an ubuntu based system"
22+
23+ pkg_install=" apt_install"
24+ alt_install=" snap_install"
25+ NEOVIM=" nvim --classic"
26+ GO=" go --classic"
27+ fi
28+
29+ INFO " Setting up shell..."
30+ $pkg_install \
1031 btop \
1132 curl \
1233 fzf \
1334 iftop \
1435 pass \
15- python \
16- python -pip \
36+ python3 \
37+ python3 -pip \
1738 tmux \
1839 wget
1940
41+ # install fonts
42+ mkdir -p " $HOME /.local/bin"
43+ curl -fsSL https://raw.githubusercontent.com/getnf/getnf/main/install.sh | bash
44+ " $HOME /.local/bin/getnf" -i DejaVuSansMono,DroidSansMono,Hack,Recursive,RobotoMono | true # don't fail on fonts
45+
2046 zsh_extras
2147
2248 starship_install
2349
2450 lazygit_install
2551
26- echo " Setting up networking..."
27- pac_install \
28- openssh
29-
30- echo " Installing developer tools..."
52+ INFO " Installing developer tools..."
3153 if [ ! -d " $HOME /workspace" ]; then
3254 mkdir -p " $HOME /workspace"
3355 fi
3456
35- pac_install \
57+ $pkg_install \
3658 cmake \
3759 gcc \
3860 llvm \
39- python-setuptools
40-
41- yay_install \
42- dust \
43- git-completion \
44- lazydocker
45-
46- echo " Installing NEOVIM..."
47- pac_install \
48- chafa \
49- git-lfs \
50- go \
51- neovim \
61+ python3-setuptools
62+
63+ INFO " Installing NEOVIM..."
64+ rust_install
65+ $alt_install $GO
66+ $alt_install $NEOVIM
67+
68+ $pkg_install \
5269 nodejs \
5370 npm \
54- python-debugpy \
55- python-gitpython \
56- python-pynvim \
57- python-ply \
58- python-ruff \
59- python-virtualenv \
60- python-yaml \
61- rust \
71+ python3-debugpy \
72+ python3-virtualenv \
6273 xclip
6374
6475 mkdir -p " $HOME /.npm-global"
@@ -68,13 +79,27 @@ function base_install() {
6879
6980 npm install -g @devcontainers/cli
7081
71- echo " Setting up docker..."
72- pac_install \
82+ INFO " Setting up docker..."
83+ $pkg_install \
7384 ca-certificates \
74- containerd \
75- docker \
76- docker-compose \
7785 gnupg
86+ if [ $system == " arch" ]; then
87+ DOCKER_PACKAGES=" containerd docker docker-compose"
88+ else
89+ $pkg_install \
90+ apt-transport-https \
91+ ca-certificates \
92+ curl \
93+ software-properties-common
94+
95+ sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
96+ echo " deb [arch=$( dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $( . /etc/os-release && echo " $VERSION_CODENAME " ) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
97+
98+ apt_update
99+ DOCKER_PACKAGES=" containerd.io docker-ce docker-ce-cli docker-buildx-plugin docker-compose-plugin"
100+ fi
101+
102+ $pkg_install $DOCKER_PACKAGES
78103
79104 sudo usermod -a -G docker " $USER "
80105 if [ ! " $CI " ]; then
0 commit comments