caed1d5b4e
- mise: 信任根目录下所有配置 (trusted_config_paths = ["/"]) - git: 全局禁用 SSL 证书验证 (http.sslVerify = false)
62 lines
1.6 KiB
Python
62 lines
1.6 KiB
Python
import decman
|
|
from decman import File, Module
|
|
from decman.plugins.pacman import packages as pacman_packages
|
|
|
|
BUN_GLOBAL_PACKAGES = [
|
|
"@mariozechner/pi-coding-agent",
|
|
"opencode-ai",
|
|
]
|
|
|
|
GO_INSTALL_PACKAGES = [
|
|
"github.com/code-yeongyu/go-claude-code-comment-checker/cmd/comment-checker@latest",
|
|
]
|
|
|
|
|
|
class DevModule(Module):
|
|
def __init__(self, user: str):
|
|
super().__init__("dev")
|
|
self.user = user
|
|
|
|
def files(self):
|
|
return {
|
|
f"/home/{self.user}/.config/mise/config.toml": File(
|
|
source_file="./home/.config/mise/config.toml",
|
|
owner=self.user,
|
|
),
|
|
}
|
|
|
|
@pacman_packages
|
|
def pacman_packages(self) -> set[str]:
|
|
return {
|
|
"bat",
|
|
"biome",
|
|
"btop",
|
|
"bun",
|
|
"eza",
|
|
"fastfetch",
|
|
"fd",
|
|
"go",
|
|
"lazygit",
|
|
"micro",
|
|
"mise",
|
|
"neovim",
|
|
"nodejs",
|
|
"ripgrep",
|
|
"trash-cli",
|
|
"uv",
|
|
"yaml-language-server",
|
|
"zoxide",
|
|
}
|
|
|
|
def after_update(self, store):
|
|
for pkg in BUN_GLOBAL_PACKAGES:
|
|
try:
|
|
decman.prg(["su", "-", self.user, "-c", f"bun add -g {pkg}"])
|
|
except Exception:
|
|
print(f"警告:安装 {pkg} 失败,跳过")
|
|
for pkg in GO_INSTALL_PACKAGES:
|
|
try:
|
|
decman.prg(["su", "-", self.user, "-c", f"go install {pkg}"])
|
|
except Exception:
|
|
print(f"警告:安装 {pkg} 失败,跳过")
|