mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-09-18 15:51:21 +02:00
feat(agents): add Crush and disable usage tracking
This commit is contained in:
@@ -35,6 +35,7 @@ Current targets:
|
||||
- OpenCode: `AGENTS.md` -> `${XDG_CONFIG_HOME:-~/.config}/opencode/AGENTS.md`
|
||||
- Pi: `AGENTS.md` -> `~/.pi/agent/AGENTS.md`
|
||||
- OMP: `AGENTS.md` -> `~/.omp/agent/AGENTS.md`
|
||||
- Crush: `AGENTS.md` -> `${XDG_CONFIG_HOME:-~/.config}/crush/CRUSH.md`
|
||||
- Generic cross-tool (read by Kimi Code): `AGENTS.md` -> `~/.agents/AGENTS.md`
|
||||
|
||||
Behavior:
|
||||
|
||||
@@ -12,6 +12,7 @@ Installed via Nix:
|
||||
- kimi-code
|
||||
- pi
|
||||
- omp
|
||||
- crush
|
||||
|
||||
## Optional tooling
|
||||
|
||||
|
||||
@@ -47,12 +47,14 @@ def main() -> int:
|
||||
opencode_dir = xdg_config_home / "opencode"
|
||||
pi_dir = Path("~/.pi/agent").expanduser()
|
||||
omp_dir = Path("~/.omp/agent").expanduser()
|
||||
crush_dir = xdg_config_home / "crush"
|
||||
agents_dir = Path("~/.agents").expanduser()
|
||||
targets = (
|
||||
(codex_dir, "AGENTS.md"),
|
||||
(opencode_dir, "AGENTS.md"),
|
||||
(pi_dir, "AGENTS.md"),
|
||||
(omp_dir, "AGENTS.md"),
|
||||
(crush_dir, "CRUSH.md"),
|
||||
(agents_dir, "AGENTS.md"),
|
||||
)
|
||||
failed = False
|
||||
|
||||
@@ -23,6 +23,7 @@ class InstallRulesTests(unittest.TestCase):
|
||||
(home / ".config" / "opencode", "AGENTS.md"),
|
||||
(home / ".pi" / "agent", "AGENTS.md"),
|
||||
(home / ".omp" / "agent", "AGENTS.md"),
|
||||
(home / ".config" / "crush", "CRUSH.md"),
|
||||
(home / ".agents", "AGENTS.md"),
|
||||
)
|
||||
for target_dir, _ in target_names:
|
||||
@@ -41,18 +42,18 @@ class InstallRulesTests(unittest.TestCase):
|
||||
patch.object(
|
||||
installer,
|
||||
"install_one",
|
||||
side_effect=[PermissionError("denied"), None, None, None, None],
|
||||
side_effect=[PermissionError("denied"), None, None, None, None, None],
|
||||
) as install,
|
||||
patch("sys.stderr", new_callable=io.StringIO) as stderr,
|
||||
):
|
||||
self.assertEqual(installer.main(), 1)
|
||||
self.assertEqual(install.call_count, 5)
|
||||
self.assertEqual(install.call_count, 6)
|
||||
self.assertIn("denied", stderr.getvalue())
|
||||
|
||||
def test_successful_targets_return_success(self):
|
||||
with patch.object(installer, "install_one") as install:
|
||||
self.assertEqual(installer.main(), 0)
|
||||
self.assertEqual(install.call_count, 5)
|
||||
self.assertEqual(install.call_count, 6)
|
||||
|
||||
def test_existing_file_is_backed_up_without_overwriting_backup(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
|
||||
@@ -1,4 +1,17 @@
|
||||
{ pkgs, llm-agents, ... }:
|
||||
let
|
||||
agentPackages = llm-agents.packages.${pkgs.stdenv.hostPlatform.system};
|
||||
codexNoAnalytics = pkgs.writeShellApplication {
|
||||
name = "codex";
|
||||
text = ''
|
||||
exec ${agentPackages.codex}/bin/codex \
|
||||
--config analytics.enabled=false \
|
||||
--config feedback.enabled=false \
|
||||
--config check_for_update_on_startup=false \
|
||||
"$@"
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
home.packages =
|
||||
with pkgs;
|
||||
@@ -8,16 +21,17 @@
|
||||
qrtool # decode/encode qr code
|
||||
]
|
||||
# AI Agent Tools
|
||||
++ (with llm-agents.packages.${pkgs.stdenv.hostPlatform.system}; [
|
||||
++ [
|
||||
# Agents
|
||||
codex
|
||||
cursor-cli
|
||||
opencode
|
||||
kimi-code
|
||||
pi
|
||||
omp
|
||||
codexNoAnalytics
|
||||
agentPackages.cursor-agent
|
||||
agentPackages.opencode
|
||||
agentPackages.kimi-code
|
||||
agentPackages.pi
|
||||
agentPackages.omp
|
||||
agentPackages.crush
|
||||
|
||||
# Utilities
|
||||
rtk # CLI proxy that reduces LLM token consumption
|
||||
]);
|
||||
agentPackages.rtk # CLI proxy that reduces LLM token consumption
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
home.sessionVariables = {
|
||||
DO_NOT_TRACK = "1";
|
||||
|
||||
KIMI_DISABLE_TELEMETRY = "1";
|
||||
|
||||
PI_TELEMETRY = "0";
|
||||
PI_SKIP_VERSION_CHECK = "1";
|
||||
|
||||
CRUSH_DISABLE_METRICS = "1";
|
||||
CRUSH_DISABLE_PROVIDER_AUTO_UPDATE = "1";
|
||||
|
||||
OPENCODE_CONFIG_CONTENT = builtins.toJSON {
|
||||
share = "disabled";
|
||||
};
|
||||
OPENCODE_DISABLE_AUTOUPDATE = "1";
|
||||
};
|
||||
}
|
||||
@@ -164,6 +164,8 @@ in
|
||||
".config/opencode"
|
||||
".local/share/opencode"
|
||||
".local/state/opencode"
|
||||
".config/crush"
|
||||
".local/share/crush"
|
||||
|
||||
# herdr: plugin registry, plugin checkouts/config, session layout
|
||||
".config/herdr"
|
||||
|
||||
@@ -1,4 +1,17 @@
|
||||
{ pkgs, llm-agents, ... }:
|
||||
let
|
||||
agentPackages = llm-agents.packages.${pkgs.stdenv.hostPlatform.system};
|
||||
codexNoAnalytics = pkgs.writeShellApplication {
|
||||
name = "codex";
|
||||
text = ''
|
||||
exec ${agentPackages.codex}/bin/codex \
|
||||
--config analytics.enabled=false \
|
||||
--config feedback.enabled=false \
|
||||
--config check_for_update_on_startup=false \
|
||||
"$@"
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
# https://github.com/Mic92/nix-ld
|
||||
#
|
||||
@@ -80,16 +93,17 @@
|
||||
conda
|
||||
]
|
||||
# AI Agent Tools
|
||||
++ (with llm-agents.packages.${pkgs.stdenv.hostPlatform.system}; [
|
||||
++ [
|
||||
# Agents
|
||||
codex
|
||||
cursor-cli
|
||||
opencode
|
||||
kimi-code
|
||||
pi
|
||||
omp
|
||||
codexNoAnalytics
|
||||
agentPackages.cursor-agent
|
||||
agentPackages.opencode
|
||||
agentPackages.kimi-code
|
||||
agentPackages.pi
|
||||
agentPackages.omp
|
||||
agentPackages.crush
|
||||
|
||||
# Utilities
|
||||
rtk # CLI proxy that reduces LLM token consumption
|
||||
]);
|
||||
agentPackages.rtk # CLI proxy that reduces LLM token consumption
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
environment.etc."codex/config.toml".text = ''
|
||||
check_for_update_on_startup = false
|
||||
|
||||
[analytics]
|
||||
enabled = false
|
||||
|
||||
[feedback]
|
||||
enabled = false
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user