1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-14 04:51:08 +01:00

codex: starting with v0.2.0 codex uses a TOML configuration file (#7388)

Updated related settings and test files to reflect the new format.
This commit is contained in:
Thierry Delafontaine 2025-07-06 15:58:22 +02:00 committed by GitHub
parent cc7407839d
commit 502d9b7d30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 88 additions and 10 deletions

View file

@ -0,0 +1,7 @@
model = "gemma3:latest"
model_provider = "ollama"
[model_providers.ollama]
baseURL = "http://localhost:11434/v1"
envKey = "OLLAMA_API_KEY"
name = "Ollama"

View file

@ -9,6 +9,6 @@
nmt.script = ''
assertFileExists home-files/.codex/AGENTS.md
assertFileContent home-files/.codex/AGENTS.md \
${./custom-instructions.md}
${./AGENTS.md}
'';
}

View file

@ -1,4 +1,7 @@
{
codex-settings = ./settings.nix;
codex-settings-toml = ./settings-toml.nix;
codex-settings-yaml = ./settings-yaml.nix;
codex-empty-settings = ./empty-settings.nix;
codex-custom-instructions = ./custom-instructions.nix;
codex-empty-custom-instructions = ./empty-custom-instructions.nix;
}

View file

@ -0,0 +1,9 @@
{
programs.codex = {
enable = true;
custom-instructions = "";
};
nmt.script = ''
assertPathNotExists home-files/.codex/AGENTS.md
'';
}

View file

@ -0,0 +1,10 @@
{
programs.codex = {
enable = true;
settings = { };
};
nmt.script = ''
assertPathNotExists home-files/.codex/config.toml
assertPathNotExists home-files/.codex/config.yaml
'';
}

View file

@ -0,0 +1,30 @@
{ pkgs, ... }:
let
codexPackage = pkgs.runCommand "codex-0.2.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 = "gemma3:latest";
model_provider = "ollama";
model_providers = {
ollama = {
name = "Ollama";
baseURL = "http://localhost:11434/v1";
envKey = "OLLAMA_API_KEY";
};
};
};
};
nmt.script = ''
assertFileExists home-files/.codex/config.toml
assertFileContent home-files/.codex/config.toml \
${./config.toml}
'';
}

View file

@ -1,6 +1,15 @@
{ pkgs, ... }:
let
codexPackage = pkgs.runCommand "codex-0.1.2504301751" { } ''
mkdir -p $out/bin
echo '#!/bin/sh' > $out/bin/codex
chmod +x $out/bin/codex
'';
in
{
programs.codex = {
enable = true;
package = codexPackage;
settings = {
model = "gemma3:latest";
provider = "ollama";
@ -16,6 +25,6 @@
nmt.script = ''
assertFileExists home-files/.codex/config.yaml
assertFileContent home-files/.codex/config.yaml \
${./settings.yml}
${./config.yaml}
'';
}