mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 18:04:08 +09:00
codex setting
This commit is contained in:
@@ -6,7 +6,12 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
source = "${config.home.homeDirectory}/dotfiles/modules/applications/codex/config.toml";
|
configDirectory =
|
||||||
|
if config.home.preferXdgDirectories then
|
||||||
|
"${config.xdg.configHome}/codex"
|
||||||
|
else
|
||||||
|
"${config.home.homeDirectory}/.codex";
|
||||||
|
configFile = "${configDirectory}/config.toml";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
programs.codex = {
|
programs.codex = {
|
||||||
@@ -20,11 +25,14 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
home.file = lib.mkIf (!config.home.preferXdgDirectories) {
|
# Keep the repository copy as an initial value. Codex may mutate the live
|
||||||
".codex/config.toml".source = config.lib.file.mkOutOfStoreSymlink source;
|
# file between activations; each Home Manager switch resets it from here.
|
||||||
};
|
home.activation.resetCodexConfig = {
|
||||||
|
after = [ "writeBoundary" ];
|
||||||
xdg.configFile = lib.mkIf config.home.preferXdgDirectories {
|
before = [ ];
|
||||||
"codex/config.toml".source = config.lib.file.mkOutOfStoreSymlink source;
|
data = ''
|
||||||
|
${pkgs.coreutils}/bin/mkdir -p ${lib.escapeShellArg configDirectory}
|
||||||
|
${pkgs.coreutils}/bin/install -m 0600 ${./config.toml} ${lib.escapeShellArg configFile}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user