fix(agents): merge Codex privacy settings

This commit is contained in:
Ryan Yin
2026-09-18 21:20:33 +08:00
committed by ryan4yin | 二花
parent 8c62b5433d
commit d47710ebe2
8 changed files with 39 additions and 36 deletions
+13
View File
@@ -0,0 +1,13 @@
def main [config_file: path, yq: path] {
mkdir ($config_file | path dirname)
if not ($config_file | path exists) {
touch $config_file
}
^$yq eval --inplace --input-format toml --output-format toml (
'.analytics.enabled = false | ' +
'.feedback.enabled = false | ' +
'.check_for_update_on_startup = false'
) $config_file
}
+17
View File
@@ -0,0 +1,17 @@
{
config,
lib,
pkgs,
llm-agents,
...
}:
let
configFile = "${config.home.homeDirectory}/.codex/config.toml";
in
{
home.packages = [ llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.codex ];
home.activation.configureCodexPrivacy = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
run ${pkgs.nushell}/bin/nu ${./codex-privacy.nu} ${lib.escapeShellArg configFile} ${lib.escapeShellArg "${pkgs.yq-go}/bin/yq"}
'';
}
+3
View File
@@ -0,0 +1,3 @@
{
home.sessionVariables.DO_NOT_TRACK = "1";
}
+2 -11
View File
@@ -1,18 +1,10 @@
{ pkgs, llm-agents, ... }: { pkgs, llm-agents, ... }:
let let
agentPackages = llm-agents.packages.${pkgs.stdenv.hostPlatform.system}; 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 in
{ {
imports = [ ../codex.nix ];
home.packages = home.packages =
with pkgs; with pkgs;
[ [
@@ -23,7 +15,6 @@ in
# AI Agent Tools # AI Agent Tools
++ [ ++ [
# Agents # Agents
codexNoAnalytics
agentPackages.opencode agentPackages.opencode
agentPackages.kimi-code agentPackages.kimi-code
agentPackages.pi agentPackages.pi
-2
View File
@@ -1,7 +1,5 @@
{ {
home.sessionVariables = { home.sessionVariables = {
DO_NOT_TRACK = "1";
KIMI_DISABLE_TELEMETRY = "1"; KIMI_DISABLE_TELEMETRY = "1";
PI_TELEMETRY = "0"; PI_TELEMETRY = "0";
+4 -1
View File
@@ -1,3 +1,6 @@
{ {
imports = [ ../../linux/core.nix ]; imports = [
../../linux/core.nix
../../base/codex.nix
];
} }
-11
View File
@@ -1,16 +1,6 @@
{ pkgs, llm-agents, ... }: { pkgs, llm-agents, ... }:
let let
agentPackages = llm-agents.packages.${pkgs.stdenv.hostPlatform.system}; 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 in
{ {
# https://github.com/Mic92/nix-ld # https://github.com/Mic92/nix-ld
@@ -95,7 +85,6 @@ in
# AI Agent Tools # AI Agent Tools
++ [ ++ [
# Agents # Agents
codexNoAnalytics
agentPackages.opencode agentPackages.opencode
agentPackages.kimi-code agentPackages.kimi-code
agentPackages.pi agentPackages.pi
-11
View File
@@ -1,11 +0,0 @@
{
environment.etc."codex/config.toml".text = ''
check_for_update_on_startup = false
[analytics]
enabled = false
[feedback]
enabled = false
'';
}