Files
nix-config/modules/dev.py
T
imbytecat caed1d5b4e feat(dev,base): 添加 mise 全局信任和 Git 跳过 SSL 验证配置
- mise: 信任根目录下所有配置 (trusted_config_paths = ["/"])
- git: 全局禁用 SSL 证书验证 (http.sslVerify = false)
2026-04-02 20:10:14 +08:00

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} 失败,跳过")