-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevbox.json
More file actions
279 lines (274 loc) · 11.3 KB
/
devbox.json
File metadata and controls
279 lines (274 loc) · 11.3 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
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
{
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.16.0/.schema/devbox.schema.json",
"packages": [
"fzf@latest",
"starship@latest",
"ripgrep@latest",
"gh@latest",
"zoxide@latest",
"tmux@latest",
"go@latest",
"cargo@latest",
"wl-clipboard@latest",
"statix@latest",
"path:devbox.d/neovim",
"git-credential-oauth@latest",
"git-credential-manager@latest",
"gitFull@latest",
"delta@latest",
"luarocks@latest",
"ghq@latest",
"tree@latest",
"difftastic@latest",
"tig@latest",
"tree-sitter@latest",
"chezmoi@latest",
"bitwarden-cli@latest",
"atuin@latest",
"nerd-fonts.hack@latest",
"nerd-fonts.noto@latest",
"nerd-fonts.fira-code@latest",
"fd@latest",
"libuuid@latest",
"dconf@latest",
"jq@latest",
"podman@latest",
"python312@latest",
"jdk21@latest",
"unzip@latest",
"p7zip@latest",
"evtest@latest",
"gcc@latest",
"blesh@latest",
"dos2unix@latest",
"htop@latest",
"github:NixOS/nixpkgs/nixos-unstable#gemini-cli-bin",
"github:NixOS/nixpkgs/nixos-unstable#geminicommit",
"github:NixOS/nixpkgs/nixos-unstable#opencode",
"nix-search-cli",
"glibcLocales@latest",
],
"env": {
"EDITOR": "vi",
"VISUAL": "vi",
"NIX_CONFIG": "experimental-features = nix-command flakes",
"LOCALE_ARCHIVE": "${DEVBOX_PACKAGES_DIR}/lib/locale/locale-archive",
},
"shell": {
"init_hook": [
"[ \"${-#*i}\" == \"$-\" ] || [ ! -t 0 ] || [ -z \"$PS1\" ] && return",
"[ -f $(blesh-share)/ble.sh ] && source $(blesh-share)/ble.sh --noattach",
// nix-ld must be enabled on the nix host
// "programs.nix-ld.enable = true;"
"uname -v | grep -q 'NixOS' && export NIX_LD=$(nix eval --impure --raw --expr '",
"let",
" pkgs = import <nixpkgs> {};",
" NIX_LD = pkgs.lib.fileContents \"${pkgs.stdenv.cc}/nix-support/dynamic-linker\";",
"in NIX_LD",
"')",
"command -v starship >/dev/null 2>&1 && eval \"$(starship init bash --print-full-init)\"",
"command -v zoxide >/dev/null 2>&1 && eval \"$(zoxide init bash)\" && alias cd='z'",
"export SUDO_EDITOR=$DEVBOX_PACKAGES_DIR/bin/nvim",
"set -o vi",
"command -v atuin >/dev/null 2>&1 && eval \"$(atuin init --disable-up-arrow bash)\"",
"for f in \"$DEVBOX_PACKAGES_DIR/share/bash-completion/completions/\"*; do",
" [ $(basename $f) = Makemodule.am ] || [ $(basename $f) = enosys ] && continue",
" source \"$f\"",
"done",
"[[ ! ${BLE_VERSION-} ]] || ble-attach",
],
"scripts": {
"config-edit": [
"$EDITOR $(devbox global path)/devbox.json",
],
"config-pull": [
"devbox global pull https://github.com/rbelem/devbox-global.git",
],
"config-push": [
"devbox global push https://github.com/rbelem/devbox-global.git",
],
"first-install": [
"devbox global run setup-git",
"devbox global run setup-tmux",
"devbox global run setup-nerd-fonts",
"devbox global run setup-themes",
"devbox global run setup-neovim",
],
"setup-nerd-fonts": [
"PREFIX=$(nix path-info $(devbox global path)/devbox.d/nerdfonts)",
"NERDFONTS_DIR=$PREFIX/share/fonts/truetype/NerdFonts",
"mkdir -p $HOME/.config/fontconfig/conf.d",
"cat <<EOF > $HOME/.config/fontconfig/conf.d/10-nerdfonts.conf",
"<?xml version='1.0'?>",
"<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>",
"<fontconfig>",
" <dir>$NERDFONTS_DIR</dir>",
"</fontconfig>",
"EOF",
"fc-cache -fv",
],
"setup-neovim": [
"git clone https://github.com/rbelem/nvchad-custom $HOME/.config/nvim",
],
"setup-devbox": [
"mkdir -p $HOME/.bashrc.d",
"cat <<EOF > $HOME/.bashrc.d/90-devbox.sh",
"[ ! -t 0 ] || [ -z \"\\$PS1\" ] && return",
"source <(devbox completion bash)",
"source <(devbox global shellenv --init-hook)",
"EOF",
],
"setup-devbox-bashrc": [
"cat <<EOF >> $HOME/.bashrc",
"",
"# User specific aliases and functions",
"if [ -d ~/.bashrc.d ]; then",
" for rc in ~/.bashrc.d/*; do",
" if [ -f \"\\$rc\" ]; then",
" . \"\\$rc\"",
" fi",
" done",
"fi",
"",
"unset rc",
"EOF",
],
"setup-flatpak": [
"flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo",
"flatpak remote-add --if-not-exists --user flathub-beta https://dl.flathub.org/beta-repo/flathub-beta.flatpakrepo",
"rm -rf $HOME/.local/share/fonts",
"uname -v | grep -q 'NixOS' \\",
" && ln -sf /run/current-system/sw/share/X11/fonts $HOME/.local/share/fonts \\",
" || ln -sf /usr/share/fonts/X11 $HOME/.local/share/fonts",
"flatpak --user override --filesystem=$HOME/.local/share/fonts",
"mkdir -p $HOME/.icons",
"mkdir -p $HOME/.local/share/icons",
"ln -sf $(nix eval --raw nixpkgs#breeze-icons.outPath)/share/icons/breeze $HOME/.icons/default",
"flatpak --user override --filesystem=$HOME/.icons",
"ln -sf $(nix eval --raw nixpkgs#breeze-icons.outPath)/share/icons/breeze $HOME/.local/share/icons/default",
"flatpak --user override --filesystem=$HOME/.local/share/icons",
],
"setup-git": [
"git config --global ghq.root $HOME/Workspace",
"for gitconfig in $(git config --get-regexp includeif.gitdir | awk '{print $1}'); do",
" dirname=${gitconfig%.path}",
" git config --global --remove-section $dirname",
"done",
"sections=\"",
" alias",
" core",
" credential.https://dev.azure.com",
" credential",
" delta",
" difftool.difftastic",
" diff",
" http",
" http.https://*.*.local",
" include",
" init",
" interactive",
" merge",
"\"",
"for section in $sections; do",
" git config --global --get-regexp '^$section' > /dev/null 2>&1 \\",
" && git config --global --remove-section $section",
"done",
"git config --global user.name 'Rodrigo Belem'",
"git config --global user.email rodrigo.belem@gmail.com",
"for gitconfig in $(find $(ghq root) -maxdepth 3 -name .gitconfig); do",
" dirname=$(dirname $gitconfig)",
" dirname=${dirname%/}/",
" git config --global includeif.gitdir:${dirname}.path \"$gitconfig\"",
"done",
"git config --global alias.br branch",
"git config --global alias.ci commit",
"git config --global alias.co checkout",
"git config --global branch.autosetupmerge always",
"git config --global branch.autosetuprebase always",
"git config --global commit.verbose true",
"git config --global init.defaultBranch main",
"git config --global --bool http.'https://*.*.local'.sslverify false",
"git config --global --add credential.helper cache",
"git config --global --add credential.helper libsecret",
"git config --global credential.cacheOptions '--timeout=7200'",
"git config --global credential.credentialStore secretservice",
"git config --global --add credential.https://bitbucket.org.helper cache",
"git config --global --add credential.https://bitbucket.org.helper manager",
"git config --global --add credential.https://dev.azure.com.helper cache",
"git config --global --add credential.https://dev.azure.com.helper manager",
"git config --global --add credential.https://git.ustc.gay.helper cache",
"git config --global --add credential.https://git.ustc.gay.helper oauth",
"git config --global --add credential.https://gitlab.com.helper cache",
"git config --global --add credential.https://gitlab.com.helper oauth",
"git config --global credential.https://dev.azure.com.useHttpPath true",
"git config --global core.pager 'less -RF'",
"git config --global pager.delta delta",
"git config --global alias.delta diff",
"git config --global interactive.diffFilter 'delta --color-only'",
"mkdir -p $HOME/.local/share/delta",
"curl -sLJ https://github.com/dandavison/delta/raw/main/themes.gitconfig \\",
" -o $HOME/.local/share/delta/themes.gitconfig",
"git config --global include.path $HOME/.local/share/delta/themes.gitconfig",
"git config --global diff.colorMoved default",
"git config --global diff.guitool meld",
"git config --global diff.tool difftastic",
"git config --global difftool.difftastic.cmd 'difft \"$LOCAL\" \"$REMOTE\"'",
"git config --global delta.features calochortus-lyallii",
"git config --global delta.line-numbers-minus-style 'bold \"#b10036\"'",
"git config --global delta.line-numbers-plus-style 'bold \"#00b136\"'",
"git config --global delta.max-line-length 1024",
"git config --global delta.navigate true",
"git config --global delta.pager 'less -RF'",
"git config --global delta.side-by-side true",
"git config --global delta.tabs 2",
"git config --global delta.true-color always",
"git config --global merge.conflictstyle diff3",
"git config --global merge.guitool meld",
"git config --global merge.tool vimdiff",
"git config --global mergetool.vimdiff.cmd \"nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'\"",
],
"setup-podman": [
"mkdir -p $HOME/.config/containers",
"cat <<EOF > $HOME/.config/containers/policy.json",
"{",
" \"default\": [{\"type\": \"insecureAcceptAnything\"}],",
" \"transports\": {\"docker-daemon\": {\"\": [{\"type\":\"insecureAcceptAnything\"}]}}",
"}",
"EOF",
],
"setup-themes": [
"ghq get https://github.com/Gogh-Co/Gogh.git",
"[ $XDG_SESSION_DESKTOP = KDE ] && export TERMINAL=konsole",
"[ $XDG_CURRENT_DESKTOP = ubuntu:GNOME ] && export TERMINAL=gnome-terminal",
"$(ghq root)/github.com/Gogh-Co/Gogh/installs/kanagawa.sh",
],
"setup-tmux": [
"[ -d $HOME/.tmux ] || git clone https://github.com/gpakosz/.tmux $HOME/.tmux",
"ln -sf $HOME/.tmux/.tmux.conf $HOME/.tmux.conf",
"ln -sf $(devbox global path)/dotfiles/.tmux.conf.local $HOME/.tmux.conf.local",
"mkdir -p $HOME/.local/bin",
"cat <<EOF > $HOME/.local/bin/t",
"#!/usr/bin/env sh",
"ARG=$(readlink -f $@)",
"cd $HOME/.tmux/plugins/tmux-session-wizard/bin",
"./t $ARG",
"EOF",
"chmod u+x $HOME/.local/bin/t",
],
"setup-kde-secrets-service": [
"service_name=$(busctl --user status org.freedesktop.secrets | sed -n 's/.*Comm=\\([[:alnum:]]*\\).*/\\1/p')",
"if [ \"$service_name\" = \"ksecretd\" ]; then",
" rm $HOME/.local/share/dbus-1/services/org.freedesktop.secrets.service",
" exit 0",
"fi",
"",
"mkdir -p $HOME/.local/share/dbus-1/services",
"cat <<EOF > $HOME/.local/share/dbus-1/services/org.freedesktop.secrets.service",
"[D-BUS Service]",
"Name=org.freedesktop.secrets",
"Exec=/usr/bin/kwalletd5",
"EOF",
],
},
},
}