mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 02:18:12 +09:00
codex setting
This commit is contained in:
@@ -6,7 +6,12 @@
|
||||
...
|
||||
}:
|
||||
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
|
||||
{
|
||||
programs.codex = {
|
||||
@@ -20,11 +25,14 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
home.file = lib.mkIf (!config.home.preferXdgDirectories) {
|
||||
".codex/config.toml".source = config.lib.file.mkOutOfStoreSymlink source;
|
||||
};
|
||||
|
||||
xdg.configFile = lib.mkIf config.home.preferXdgDirectories {
|
||||
"codex/config.toml".source = config.lib.file.mkOutOfStoreSymlink source;
|
||||
# Keep the repository copy as an initial value. Codex may mutate the live
|
||||
# file between activations; each Home Manager switch resets it from here.
|
||||
home.activation.resetCodexConfig = {
|
||||
after = [ "writeBoundary" ];
|
||||
before = [ ];
|
||||
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