-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpacman.nu
executable file
·309 lines (279 loc) · 9.99 KB
/
pacman.nu
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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
#!/usr/bin/env nu
const MANIFEST = {
# 社交
QQ: { packages: ["linuxqq-nt-bwrap"], manager: "paru" },
telegram: { packages: ["telegram-desktop"], },
wechat: { packages: ["wechat-universal-bwrap"], manager: "paru", },
wemeet: { packages: ["wemeet-bin"], manager: "paru", },
feishu: { packages: ["feishu-bin"], manager: "paru", },
# OS
QEMU: { packages: ["qemu-full"], },
ventoy: { manager: "paru", packages: ["ventoy-bin"], desc: "制作镜像盘" },
podman: "容器运行时",
# kernel
mkinitcpio-firmware.manager: "paru",
sof-firmware: "Audio card firmware",
linux-headers: "内核头文件",
pipewire: { packages: [ "pipewire", "wireplumber", "pipewire-pulse", "pipewire-alsa", "pipewire-jack", "pipewire-v4l2" ], desc: "音频系统" },
ntp: "Time sync daemon",
# PL
gdb: "GNU 调试器",
lldb: "LLVM 调试器",
mold: "现代链接器",
rust-script: "rust 脚本解释器",
rustup: "管理 rust 工具链",
tokei: "统计代码",
gcc: "GNU 的C/C++工具链",
rescript: { manager: "npm", desc: "rescript 工具链" },
nrm: { manager: "npm", desc: "管理npm镜像源" },
cargo-binutils: { manager: "cargo", desc: "Rust二进制工具" },
lua-language-server: "",
stylua: "lua格式化器",
taplo-cli: "toml语言工具",
shfmt: "bash/zsh格式化器",
gopls: "Go语言服务器",
yaml-language-server: { manager: "npm" },
volar: { manager: "npm", packages: ["@vue/language-server"] },
prettier: { manager: "npm", packages: ["prettier", "@prettier/plugin-xml"], desc: "前端格式化器" },
mise: "管理语言工具链",
bash-language-server: { manager: "npm" },
mlc: { manager: "cargo", desc: "markdown linter" },
sccache: "编译缓存",
kondo: "扫除编译产物",
cargo-flamegraph: "绘制火焰图及cargo配套插件",
clang: { packages: ["clang", "llvm"], desc: "C/C++工具链" },
slint-lsp: { manager: "cargo", desc: "slint lsp" },
typescript: { manager: "npm", packages: ["typescript", "typescript-language-server"] },
typst: { packages: ["typst", "typstyle-bin"], manager: "paru" },
tinymist-bin: ""
tree-sitter-cli: "安装tree-sitter解析器",
uv: "python项目管理",
ruff: "python格式化器",
basedpyright: { manager: "uv", desc: "python语言服务器", },
hugo: "blog",
cmake-language-server: "Cmake Language Server",
strace: "Bin stack trace",
qt6-languageserver: "qt6 languageserver"
# desktop
xdg-user-dirs: "规范目录",
qt-theme: { packages: ["qt6ct", "qt5ct", "kvantum"] },
kitty: "kitty",
wezterm: { packages: ["wezterm-git"], desc: "现代终端模拟器" },
dolphin: { packages: ["dolphin", "ffmpegthumbs", "kdegraphics-thumbnailers"], desc: "KDE文件管理器" },
spectacle: "KDE截图",
fcitx: { packages: ["fcitx5-im", "fcitx5-chinese-addons", "fcitx5-pinyin-zhwiki"], desc: "小企鹅输入法" },
nerd-fonts: "书呆子字体",
noto-fonts: { packages: [ "noto-fonts", "noto-fonts-emoji", "noto-fonts-extra", "noto-fonts-cjk" ], desc: "零豆腐块字体" },
polkit-kde-agent: "Authorization Panel",
polkit: "Policy kit",
thunar: { packages: [ "thunar", "tumbler", "webp-pixbuf-loader" ], desc: "File manager" },
bluez: "Blutooth kernel",
bluez-utils: "Bluetooth cli",
## wayland
wl-clipboard: "剪贴板",
cliphist: "剪贴板历史",
swww: "Wallpaper engine",
waybar: "Status bar",
grim: "Screen cut",
slurp: "Screen area cut",
wf-recorder: "wayland screen recorder",
dunst: "Notify channel",
satty: { manager: "paru", desc: "Screen cut editor" },
hyprland: { packages: [ "hyprland", "hyprlock", "hypridle", "wlroots", "cpio", "xdg-desktop-portal-hyprland-git", "qt5-wayland" ] },
rofi-wayland: "Menu",
# clients
firefox: "Mozilla firefox",
dbeaver: "PostgreSQL客户端",
sqlitebrowser: "SQLite客户端",
wps: { packages: [ "wps-office-cn", "wps-office-mui-zh-cn", ], manager: "paru", desc: "WPS本体+中文语言包" },
# shell
nushell: "结构化shell",
mcfly: "历史命令",
starship: "装饰提示符",
zoxide: "瞬移",
zellij: "终端复用器",
bash-completion: "bash补全",
zsh: { packages: ["zsh", "zsh-completions"], desc: "zsh 及额外补全包" },
terminus-font: "Outter terminal font",
# filesystem
eza: "高级ls",
rsync: "超级复制",
parallel-disk-usage: "磁盘空间统计",
yazi: { packages: ["yazi-git", "jq", "ffmpegthumbnailer", "unarchiver"], desc: "终端文件管理器" },
gparted: "分区GUI",
exfatprogs: "exfat格式化工具",
conceal: { packages: ["conceal-bin"], manager: "paru", desc: "垃圾回收站" },
# utility
man: { packages: ["man-db", "man-pages"], desc: "手册" },
less: "pager",
bat: "高级cat",
choose: "高级cut",
dos2unix: "改变文本的平台",
enca: "检查文件编码",
fd: "搜索文件",
jaq: "高级jq",
jless: "json阅读器",
ripgrep: "正则匹配行",
ripgrep-all: "万能正则匹配行",
sd: "高级sed",
skim: "模糊搜索.rs",
fzf: "模糊搜索.go",
tree: "树视图",
protobuf: "ProtocolBuffers",
navi: "命令速查",
pastel: "调色板",
hyperfine: "竞争测试",
pueue: "守护大任务",
hexyl: "hex查看器",
libtree: "程序的库依赖树视图",
# git
gitui: "git TUI",
difftastic: "语言diff",
git-cliff: "变更日志生成器",
gitoxide: "锈化git",
git-filter-repo: "过滤git项目",
serie: "分支树",
# data
p7zip: "7z",
unrar: "解压RAR",
zip: { packages: ["zip", "unzip"] },
qbittorrent: "下载种子",
# media
imagemagick: "图片瑞士军刀",
mpv: "看视频",
viu: "终端看图",
yt-dlp: "下载Youtube视频",
dagtoc: { packages: ["dagtoc-bin"], manager: "paru", desc: "操作PDF目录" },
pandoc: { packages: ["pandoc-bin"], desc: "LaTex渲染器" },
kid3-qt: "编辑音乐标签",
krita: "绘画",
espeak: { packages: ["espeak-ng"], desc: "Ebook speaker" },
mupdf-tools: "PDF工具箱",
gwenview: "看图",
zathura: { packages: ["zathura", "zathura-pdf-mupdf"], desc: "PDF阅读器" },
webp-pixbuf-loader: "GDK的webp支持",
inkscape: "操作矢量图",
# language
pot-translation: "一站式翻译",
didyoumean: { packages: ["didyoumean-bin"], manager: "paru", desc: "纠正英文单词" },
# monitor
acpi: "电池信息",
bandwhich: "监测网络带宽",
bottom: "高级top",
light: "调节亮度",
brightnessctl: "Adjust lightness",
pamixer: "调节音量",
procs: "查看进程",
pulsemixer: "音量面板",
duf: "统计分区大小",
erdtree: "体积伴随文件树",
macchina: "系统信息",
udisk: { packages: ["udisks2", "udiskie"], desc: "Usb device auto mount" },
# network
networkmanager: "",
gping: "图形化ping",
traceroute: "路由显形",
lsof: "监测端口",
v2raya: "飞越长城",
clash-verge: "飞越长城",
openssh: "ssh",
# show
asciinema: "录制命令行视频",
screenkey: "按键回显",
silicon: "代码截图",
obs-studio: "流录制",
# cargo
cargo-generate: "项目模板",
cargo-machete: "检查无用依赖",
cargo-msrv: "最旧可用rustc版本",
cargo-expand: "展开宏",
cargo-edit: "编辑依赖",
cargo-supply-chain: "依赖元信息",
cargo-deny: "分析依赖",
cargo-audit: { packages: ["cargo-audit", "cargo-auditable"], desc: "审计" },
cargo-depgraph: "依赖图",
cargo-update: "更新cargo安装的应用",
cargo-cache: { manager: "cargo", desc: "管理缓存" },
cross: { manager: "cargo", desc: "交叉编译" },
cargo-zigbuild: "无痛链接指定版本glibc",
cargo-wizard: { manager: "cargo", desc: "编译配置" },
cargo-binstall: "下载crate的二进制",
cargo-get: { manager: "cargo", desc: "读取Cargo.toml信息" },
# arch
nvchecker: "检查包版本",
pacman-contrib: "打包工具箱",
aurpublish: "打包钩子",
archlinuxcn-keyring: "",
# amd
mesa-vdpau: "Gpu video accelerator",
amd-ucode: "AMD CPU driver",
xf86-video-amdgpu: "AMD GPU video accelerator",
# misc
qalculate-qt: "Calculator",
vmware-workstation.manager: "paru",
v4l2loopback-dkms: "Virtual camera with screen",
rclone: "Net Drive Synchronization"
libfido2: "ssh-agent dependency"
}
def main [] {
let manifest = $MANIFEST
| items {|k, v|
if ($v | describe) == 'string' {
{
name: $k,
desc: $v,
}
} else {
{
name: $k,
...$v
}
}
}
let paru = try { which paru | get 0 | get path }
let cargo = try { which cargo | get 0 | get path }
let cargo_bin = try { which cargo-binstall | get 0 | get path }
let npm = try { which npm | get 0 | get path }
let uv = try { which uv | get 0 | get path }
mut tbl = {
pacman: [],
paru: [],
cargo: [],
# 'cargo:src': [],
npm: [],
uv: [],
}
for it in $manifest {
let packages = try { $it.packages } | default [$it.name]
let mgr = try { $it.manager } | default 'pacman'
let subtbl = $tbl | get $mgr | append $packages
$tbl = $tbl | upsert $mgr $subtbl
}
try {
if $paru != null {
paru -Sy --needed ...$tbl.paru
} else {
pacman -Sy --needed ...$tbl.pacman
}
}
try {
if $npm != null {
npm install -g ...$tbl.npm
}
}
try {
if $cargo_bin != null {
cargo binstall ...$tbl.cargo
}
}
# try {
# if $cargo != null {
# cargo install ...$tbl.'cargo:src'
# }
# }
try {
if $uv != null {
uv tool install ...$tbl.uv
}
}
}