mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-02 19:49:18 +00:00
Codex 0.134.0 stopped reading profile settings from [profiles.<name>] in config.toml and no longer supports the top-level profile selector. Add a dedicated programs.codex.profiles option so Home Manager can write CODEX_HOME/<name>.config.toml files that match the current CLI --profile behavior. For Codex 0.134.0 and later, legacy programs.codex.settings.profiles entries are migrated into profile files with a warning, and removed legacy profile keys are omitted from config.toml so strict config loading keeps working. Older Codex versions keep the legacy config shape.
44 lines
1.1 KiB
Nix
44 lines
1.1 KiB
Nix
{ pkgs, ... }:
|
|
let
|
|
codexPackage = pkgs.runCommand "codex-0.134.0" { } ''
|
|
mkdir -p $out/bin
|
|
echo '#!/bin/sh' > $out/bin/codex
|
|
chmod +x $out/bin/codex
|
|
'';
|
|
in
|
|
{
|
|
programs.codex = {
|
|
enable = true;
|
|
package = codexPackage;
|
|
settings = {
|
|
model = "gpt-5";
|
|
};
|
|
profiles = {
|
|
deep-review = {
|
|
approval_policy = "on-request";
|
|
model = "gpt-5.5";
|
|
model_reasoning_effort = "xhigh";
|
|
sandbox_mode = "workspace-write";
|
|
};
|
|
ci = {
|
|
approval_policy = "never";
|
|
sandbox_mode = "workspace-write";
|
|
};
|
|
};
|
|
};
|
|
|
|
test.asserts.warnings.expected = [ ];
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-files/.codex/config.toml
|
|
assertFileContent home-files/.codex/config.toml \
|
|
${./profiles-config.toml}
|
|
assertFileExists home-files/.codex/deep-review.config.toml
|
|
assertFileContent home-files/.codex/deep-review.config.toml \
|
|
${./profiles-deep-review.toml}
|
|
assertFileExists home-files/.codex/ci.config.toml
|
|
assertFileContent home-files/.codex/ci.config.toml \
|
|
${./profiles-ci.toml}
|
|
'';
|
|
}
|