-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·158 lines (131 loc) · 3.69 KB
/
setup.sh
File metadata and controls
executable file
·158 lines (131 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/usr/bin/env bash
set -ex -o pipefail
CONFIG_DIR=${CONFIG_DIR:-$HOME/Documentos/config}
sudo systemctl mask \
sleep.target suspend.target hibernate.target hybrid-sleep.target
sudo sed -i 's/trixie/testing/g' /etc/apt/sources.list
sudo apt update
sudo apt dist-upgrade -y
sudo apt install \
amberol totem transmission-gtk fonts-noto-color-emoji \
rclone curl \
nodejs neovim git make shellcheck
sudo apt install --no-install-recommends \
gdm3 gnome-session gnome-shell gnome-terminal gnome-shell-extension-prefs
_tailscale () {
if command -v tailscale; then
printf "already installed\n"
else
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
fi
}
_tailscale
_uv () {
if command -v uv; then
printf "already installed\n"
else
curl -LsSf https://astral.sh/uv/install.sh | sh
echo 'eval "$(uv generate-shell-completion bash)"' >> ~/.bashrc
echo 'eval "$(uvx --generate-shell-completion bash)"' >> ~/.bashrc
fi
}
_uv
_llm () {
if command -v llm; then
printf "already installed\n"
else
uv tool install llm
llm install llm-gemini
llm models default gemini-2.0-flash
llm keys set gemini --value $(cat $CONFIG_DIR/gemini.key)
fi
}
_llm
_nvim () {
if [[ -d ~/.config/nvim/pack/github/start/copilot.vim ]]; then
printf "already set up\n"
else
git clone https://github.com/github/copilot.vim.git \
~/.config/nvim/pack/github/start/copilot.vim
nvim --headless +"Copilot setup" +q
fi
}
_nvim
_chrome () {
if command -v google-chrome; then
printf "already installed\n"
else
curl -fSsL https://dl.google.com/linux/linux_signing_key.pub \
| sudo gpg --dearmor \
| sudo tee /usr/share/keyrings/google-chrome.gpg >> /dev/null
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" \
| sudo tee /etc/apt/sources.list.d/google-chrome.list
sudo apt update
sudo apt install google-chrome-stable
fi
}
_chrome
_nft () {
sudo cp "$CONFIG_DIR/nftables.conf" /etc/nftables.conf
sudo systemctl enable nftables
printf "net.ipv4.ip_forward=1" \
| sudo tee /etc/sysctl.d/95-IPv4-forwarding.conf
sudo sysctl -p /etc/sysctl.d/95-IPv4-forwarding.conf
}
_nft
_rclone () {
if [[ -f ~/.config/rclone/rclone.conf ]]; then
printf "already set up\n"
else
mkdir -p ~/.config/rclone
cp "$CONFIG_DIR/rclone.conf" ~/.config/rclone/rclone.conf
rclone --filter "- .**" bisync \
remote:Music ~/Música --resync --remove-empty-dirs
rclone --filter "- .**" bisync \
remote:Pictures ~/Imágenes --resync --remove-empty-dirs
rclone --filter "- .**" bisync \
remote:Documents ~/Documentos --resync --remove-empty-dirs
fi
}
_rclone
_cron () {
if crontab -l >/dev/null 2>&1; then
printf "already set up\n"
else
crontab "$CONFIG_DIR/crontab.txt"
fi
}
_cron
_docker () {
if command -v docker; then
printf "already installed\n"
else
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg \
-o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb https://download.docker.com/linux/debian bookworm stable" \
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install docker-ce uidmap
sudo systemctl disable --now docker.service docker.socket
sudo rm /var/run/docker.sock
dockerd-rootless-setuptool.sh install
systemctl --user enable docker
fi
}
_docker
_tlp () {
if [[ $(hostnamectl chassis) == "desktop" ]]; then
printf "unneeded\n"
else
sudo apt install tlp
sudo tlp start
fi
}
_tlp
printf "done!\n"
read -n 1 -s -r -p "Press y to reboot: " reply
[[ $reply == "y" ]] && sudo reboot