-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.toml
241 lines (201 loc) · 7.1 KB
/
Makefile.toml
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# ==============================================================================
# How to Use
# ==============================================================================
# To initialize the environment:
# $ cargo make init
#
# To update tools and dependencies:
# $ cargo make update
#
# To check for updates:
# $ cargo make check-outdated
#
# You can also run individual tasks as needed. Examples:
# $ cargo make install-rust # Install Rust and components
# $ cargo make install-tools # Install platform-specific tools
# ==============================================================================
# ==========================
# ==== Main Setup Task =====
# ==========================
[tasks.init]
description = "Set up the development environment"
dependencies = [
"install-rust", # Install Rust and its components
"install-tools", # Install platform-specific tools
"install-coreutils", # Install platform-specific coreutils
"install-rust-tools", # Install additional Rust tools
"dotfiles", # Symlink dotfiles
]
[tasks.install-rust]
description = "Install Rust toolchain components."
script = [
"rustup component add clippy",
"rustup component add rustfmt"
]
[tasks.install-rust-tools]
script = [
"cargo install mise",
"cargo install dotter",
"cargo install cargo-update",
"cargo install vivid",
"cargo install eza",
"cargo install bottom",
"cargo install bat",
]
# Platform-Specific Coreutils Installation
[tasks.install-coreutils]
linux_alias = "linux-core-utils"
windows_alias = "windows-core-utils"
mac_alias = "mac-core-utils"
[tasks.linux-core-utils]
condition = { platforms = ["linux"] }
script = [
# not working "cargo install coreutils --features unix"
]
[tasks.windows-core-utils]
condition = { platforms = ["windows"] }
script = [
"cargo install coreutils --features windows"
]
[tasks.mac-core-utils]
condition = { platforms = ["mac"] }
script = [
"cargo install coreutils --features macos"
]
# Platform-Specific Tool Installation
[tasks.install-tools]
linux_alias = "linux-tools"
windows_alias = "windows-tools"
mac_alias = "mac-tools"
[tasks.linux-tools]
script = [
"echo --- Setup ---",
"sudo dnf5 install -y dnf-plugins-core",
"sudo dnf5 install @c-development",
"echo '--- Enabling COPR Repositories ---'",
"sudo dnf5 copr enable atim/lazygit -y",
"echo '--- Installing Linux Tools ---'",
"sudo dnf5 install -y lazygit neovim fzf ripgrep fd-find bat --skip-unavailable",
'sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"',
"echo '--- Installing Languages ---'",
"sudo dnf5 install -y python3 golang lua lua-devel luarocks nodejs --skip-unavailable",
"echo '--- Installing Dependencies ---'",
"sudo dnf5 install -y fira-code-fonts gcc gcc-c++ cmake fastfetch fontconfig --skip-unavailable",
"echo '--- Setting Environment Variables ---'",
"export YAZI_CONFIG_HOME=\"$HOME/.config/yazi\"", # Yazi config file
]
[tasks.windows-tools]
script = [
# "echo --- Scoop Setup ---",
# "echo Adding Scoop buckets...",
# "scoop bucket add extras || true",
# "scoop bucket add nerd-fonts || true",
# "scoop bucket add versions || true",
"echo --- Installing Tools ---",
"scoop install lazygit neovim yazi wezterm-nightly fzf ripgrep bat",
"echo --- Installing Languages ---",
"scoop install python go lua lua51 luarocks stylua",
"echo --- Installing Dependencies ---",
"scoop install autohotkey gcc cmake fastfetch firacode",
"scoop shim add gcc ~\\scoop\\apps\\gcc\\current\\bin\\gcc.exe", # Needed for NVim Telescope FZF Native
"echo --- Setting Environment Variables ---",
'setx XDG_CONFIG_HOME "%USERPROFILE%\\.config"', # Nushell home directory
'setx YAZI_CONFIG_HOME "%USERPROFILE%\\.config\\yazi"', # Yazi config file
]
[tasks.mac-tools]
script = [
"[ -x \"$(command -v brew)\" ] || { echo 'Homebrew is not installed. Please install Homebrew first.'; exit 1; }",
"echo '--- Installing Tools ---'",
"brew tap FelixKratz/formulae",
"brew install borders"
"brew install yazi lazygit bat fzf ripgrep fd fastfetch cmake openssl",
"brew install --cask ghostty",
"brew install --cask nikitabobko/tap/aerospace@0.12.0"
'sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"',
"echo --- Installing Languages ---",
"brew install lua lua51 luarocks go python node",
"echo '--- Managing Fonts ---'",
"brew tap homebrew/cask-fonts",
"brew install --cask font-fira-code",
"echo '--- Setting Environment Variables ---'",
"export YAZI_CONFIG_HOME=\"~/.config/yazi\"",
]
[tasks.dotfiles]
description = "Symlink all the .dotfiles depending on dotter/system.toml files"
script = [
"echo --- Creating Symlinks ---",
"dotter -v",
]
# ==========================
# ==== Main Update Task ====
# ==========================
[tasks.update]
description = "Update all tools, dependencies, and configurations"
dependencies = [
"update-rust", # Update Rust toolchain and components
"update-platform-tools", # Update platform-specific tools
"update-mise", # Update mise configurations
"dotfiles", # Take the chance to validate the dotfiles
]
# Rust Toolchain Update
[tasks.update-rust]
script = [
"rustup self update",
"rustup update",
"cargo install-update -a"
]
# Platform-Specific Tools Update
[tasks.update-platform-tools]
linux_alias = "update-linux-tools"
windows_alias = "update-windows-tools"
mac_alias = "update-mac-tools"
[tasks.update-linux-tools]
script = []
[tasks.update-windows-tools]
script = [
"echo --- Updating Scoop & Packages ---",
"scoop update",
"scoop update *",
]
[tasks.update-mac-tools]
script = [
"echo --- Updating Homebrew & Packages ---",
"brew update",
"brew upgrade",
"brew upgrade --cask wezterm@nightly --no-quarantine --greedy-latest",
]
[tasks.update-mise]
script = ["echo --- Updating Global Mise Packages ---", "mise install"]
# ================================
# ==== Check for Updates Task ====
# ================================
[tasks.check-outdated]
description = "Set up the development environment"
dependencies = [
"check-outdated-rust", # Check rustup for updates
"check-package-managers", # Check platform specific updates
]
[tasks.check-outdated-rust]
script = [
"echo --- Checking for available updates (without applying) ---",
"rustup update --no-self-update || echo 'Rustup is up-to-date'",
]
[tasks.check-package-managers]
linux_alias = "check-outdated-linux"
windows_alias = "check-outdated-windows"
mac_alias = "check-outdated-mac"
# TODO
[tasks.check-outdated-linux]
script = [
"echo --- Checking for outdated pacman packages ---",
]
[tasks.check-outdated-windows]
script = [
"echo --- Checking for outdated Scoop packages ---",
"scoop status || echo 'Scoop not found or not running on Windows'",
]
[tasks.check-outdated-mac]
script = [
"echo --- Checking for outdated Homebrew packages ---",
"brew outdated || echo 'No outdated packages found or not running on macOS'",
]