mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-03 12:09:19 +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.
32 lines
730 B
Nix
32 lines
730 B
Nix
{ pkgs, ... }:
|
|
let
|
|
codexPackage = pkgs.runCommand "codex-0.133.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";
|
|
profile = "deep-review";
|
|
profiles.deep-review = {
|
|
approval_policy = "on-request";
|
|
sandbox_mode = "workspace-write";
|
|
};
|
|
};
|
|
};
|
|
|
|
test.asserts.warnings.expected = [ ];
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-files/.codex/config.toml
|
|
assertFileContent home-files/.codex/config.toml \
|
|
${./profiles-legacy-old-version.toml}
|
|
assertPathNotExists home-files/.codex/deep-review.config.toml
|
|
'';
|
|
}
|