generate .continue/config.yaml via configuration
This commit is contained in:
parent
2c77cf2ed4
commit
393f468be2
6 changed files with 117 additions and 20 deletions
|
@ -1,3 +1,75 @@
|
|||
{...}: {
|
||||
# TODO: enable option for continue.yaml for home based on options defined in osConfig.ai.models
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
ai-tooling-enabled = config.user.continue.enable && osConfig.host.ai.enable;
|
||||
in {
|
||||
options = {
|
||||
user.continue = {
|
||||
enable = lib.mkEnableOption "should continue be enabled on this machine";
|
||||
docs = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule ({name, ...}: {
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = name;
|
||||
};
|
||||
startUrl = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
};
|
||||
}));
|
||||
};
|
||||
context = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule ({name, ...}: {
|
||||
options = {
|
||||
provider = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = name;
|
||||
};
|
||||
};
|
||||
}));
|
||||
default = {
|
||||
"code" = {};
|
||||
"docs" = {};
|
||||
"diff" = {};
|
||||
"terminal" = {};
|
||||
"problems" = {};
|
||||
"folder" = {};
|
||||
"codebase" = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config =
|
||||
lib.mkIf ai-tooling-enabled
|
||||
(lib.mkMerge [
|
||||
{
|
||||
home = {
|
||||
file = {
|
||||
".continue/config.yaml".source = (pkgs.formats.yaml {}).generate "continue-config" {
|
||||
name = "Assistant";
|
||||
version = "1.0.0";
|
||||
schema = "v1";
|
||||
models = lib.attrsets.attrValues osConfig.host.ai.models;
|
||||
context = lib.attrsets.attrValues config.user.continue.context;
|
||||
docs = lib.attrsets.attrValues config.user.continue.docs;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
(lib.mkIf osConfig.host.impermanence.enable {
|
||||
home.persistence."/persist${config.home.homeDirectory}" = {
|
||||
directories = [
|
||||
".continue/index"
|
||||
".continue/sessions"
|
||||
];
|
||||
allowOther = true;
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue