mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
gemini-cli: add context option
Support a GEMINI.md file for base context at global level. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
02d23e6291
commit
e2d346936e
1 changed files with 30 additions and 0 deletions
|
|
@ -89,6 +89,33 @@ in
|
||||||
Will be set as $GEMINI_MODEL.
|
Will be set as $GEMINI_MODEL.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
context = lib.mkOption {
|
||||||
|
type = lib.types.nullOr (lib.types.either lib.types.lines lib.types.path);
|
||||||
|
default = null;
|
||||||
|
example = lib.literalExpression ''
|
||||||
|
# Inline content example:
|
||||||
|
'''
|
||||||
|
# Global Context
|
||||||
|
|
||||||
|
You are a helpful AI assistant for software development.
|
||||||
|
|
||||||
|
## Coding Standards
|
||||||
|
|
||||||
|
- Follow consistent code style
|
||||||
|
- Write clear comments
|
||||||
|
- Test your changes
|
||||||
|
'''
|
||||||
|
|
||||||
|
# Or reference an existing file:
|
||||||
|
# ./path/to/GEMINI.md
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Global context instructions that will be available across all projects.
|
||||||
|
|
||||||
|
This will be written to `~/.gemini/GEMINI.md`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable (
|
config = lib.mkIf cfg.enable (
|
||||||
|
|
@ -99,6 +126,9 @@ in
|
||||||
file.".gemini/settings.json" = lib.mkIf (cfg.settings != { }) {
|
file.".gemini/settings.json" = lib.mkIf (cfg.settings != { }) {
|
||||||
source = jsonFormat.generate "gemini-cli-settings.json" cfg.settings;
|
source = jsonFormat.generate "gemini-cli-settings.json" cfg.settings;
|
||||||
};
|
};
|
||||||
|
file.".gemini/GEMINI.md" = lib.mkIf (cfg.context != null) (
|
||||||
|
if lib.isPath cfg.context then { source = cfg.context; } else { text = cfg.context; }
|
||||||
|
);
|
||||||
sessionVariables.GEMINI_MODEL = cfg.defaultModel;
|
sessionVariables.GEMINI_MODEL = cfg.defaultModel;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue