Skip to content

Commit 75f845f

Browse files
committed
Add functions for more particular installs
1 parent f2914aa commit 75f845f

File tree

3 files changed

+59
-36
lines changed

3 files changed

+59
-36
lines changed

scripts/base_install.sh

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ function base_install() {
5151
wget
5252

5353
# install fonts
54-
mkdir -p "$HOME/.local/bin"
55-
curl -fsSL https://raw.githubusercontent.com/getnf/getnf/main/install.sh | bash
56-
"$HOME/.local/bin/getnf" -i DejaVuSansMono,DroidSansMono,Hack,Recursive,RobotoMono | true # don't fail on fonts
54+
install_fonts
5755

5856
zsh_extras
5957

@@ -101,7 +99,8 @@ function base_install() {
10199
xclip
102100

103101
sudo npm install -g neovim tree-sitter
104-
curl -sSL https://get.rvm.io | bash -s -- --auto-dotfiles
102+
103+
install_rvm
105104

106105
INFO "Install Devcontainer dependencies"
107106
sudo npm install -g @devcontainers/cli
@@ -110,30 +109,14 @@ function base_install() {
110109
$pkg_install \
111110
ca-certificates \
112111
gnupg
113-
if [ "$system" == "arch" ]; then
114-
DOCKER_PACKAGES=("containerd" "docker" "docker-compose")
115-
else
112+
if [ "$system" != "arch" ]; then
116113
$pkg_install \
117114
apt-transport-https \
118115
curl \
119116
software-properties-common
120-
121-
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
122-
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
123-
124-
apt_update
125-
DOCKER_PACKAGES=("docker-ce" "docker-ce-cli" "docker-buildx-plugin" "docker-compose-plugin")
126117
fi
127118

128-
$pkg_install "${DOCKER_PACKAGES[@]}"
129-
130-
sudo usermod -a -G docker "$USER"
131-
if [ ! "$CI" ]; then
132-
sudo systemctl daemon-reload
133-
sudo systemctl enable docker
134-
sudo systemctl start docker
135-
fi
119+
docker_install
136120

137-
echo "net.core.rmem_max=26214400" | sudo tee /etc/sysctl.d/10-udp-buffer-sizes.conf
138-
echo "net.core.rmem_default=26214400" | sudo tee -a /etc/sysctl.d/10-udp-buffer-sizes.conf
121+
increase_network_kernel_mem
139122
}

scripts/main.sh

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,8 @@ function base_sys() {
7777

7878
pacstall_install slack-deb
7979

80-
if [ "$(which 1password)" == "" ]; then
81-
deb_install 1password https://downloads.1password.com/linux/debian/amd64/stable/1password-latest.deb
82-
fi
83-
84-
if [ "$(which vivaldi)" == "" ]; then
85-
deb_install vivaldi https://downloads.vivaldi.com/stable/vivaldi-stable_7.5.3735.54-1_amd64.deb
86-
87-
# add 1password support to vivaldi
88-
sudo mkdir -p /etc/1password
89-
echo "vivalid" | sudo tee /etc/1password/custom_allowed_browsers
90-
sudo chown root:root /etc/1password/custom_allowed_browsers
91-
sudo chmod 755 /etc/1password/custom_allowed_browsers
92-
fi
80+
install_1password
81+
install_vivaldi
9382

9483
apt_install \
9584
gnome-browser-connector

scripts/utils.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,3 +264,54 @@ function install_nvim() {
264264
sudo mv nvim.appimage /usr/bin/nvim
265265
sudo chmod u+x /usr/bin/nvim
266266
}
267+
268+
function install_docker() {
269+
if [ "$system" == "arch" ]; then
270+
pkg_install="pac_install"
271+
DOCKER_PACKAGES=("containerd" "docker" "docker-compose")
272+
else
273+
pkg_install="apt_install"
274+
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
275+
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
276+
277+
apt_update
278+
DOCKER_PACKAGES=("docker-ce" "docker-ce-cli" "docker-buildx-plugin" "docker-compose-plugin")
279+
fi
280+
281+
$pkg_install "${DOCKER_PACKAGES[@]}"
282+
283+
sudo usermod -a -G docker "$USER"
284+
if [ ! "$CI" ]; then
285+
sudo systemctl daemon-reload
286+
sudo systemctl enable docker
287+
sudo systemctl start docker
288+
fi
289+
}
290+
291+
function install_fonts() {
292+
mkdir -p "$HOME/.local/bin"
293+
curl -fsSL https://raw.githubusercontent.com/getnf/getnf/main/install.sh | bash
294+
"$HOME/.local/bin/getnf" -i DejaVuSansMono,DroidSansMono,Hack,Recursive,RobotoMono | true # don't fail on fonts
295+
}
296+
297+
function increase_network_kernel_mem() {
298+
echo "net.core.rmem_max=26214400" | sudo tee /etc/sysctl.d/10-udp-buffer-sizes.conf
299+
echo "net.core.rmem_default=26214400" | sudo tee -a /etc/sysctl.d/10-udp-buffer-sizes.conf
300+
}
301+
302+
function install_rvm() {
303+
curl -sSL https://get.rvm.io | bash -s -- --auto-dotfiles
304+
}
305+
306+
function install_1password() {
307+
deb_install 1password https://downloads.1password.com/linux/debian/amd64/stable/1password-latest.deb
308+
# add 1password support to vivaldi
309+
sudo mkdir -p /etc/1password
310+
echo "vivalid" | sudo tee /etc/1password/custom_allowed_browsers
311+
sudo chown root:root /etc/1password/custom_allowed_browsers
312+
sudo chmod 755 /etc/1password/custom_allowed_browsers
313+
}
314+
315+
function install_vivaldi() {
316+
deb_install vivaldi https://downloads.vivaldi.com/stable/vivaldi-stable_7.5.3735.54-1_amd64.deb
317+
}

0 commit comments

Comments
 (0)