1
0
Fork 0
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:
Austin Horstman 2025-10-12 17:20:55 -05:00
parent 02d23e6291
commit e2d346936e

View file

@ -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;
}; };
} }