refactor(ai-tools): move options into 'default.nix'
This commit is contained in:
@@ -9,8 +9,6 @@ let
|
|||||||
rtk-version = "0.18.1";
|
rtk-version = "0.18.1";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.ai-tools.claude-code.enable = lib.mkEnableOption "claude code with rtk and ccline";
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
programs.claude-code.enable = true;
|
programs.claude-code.enable = true;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,33 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
skillType = lib.types.submodule {
|
||||||
|
options = {
|
||||||
|
owner = lib.mkOption { type = lib.types.str; };
|
||||||
|
repo = lib.mkOption { type = lib.types.str; };
|
||||||
|
rev = lib.mkOption { type = lib.types.str; };
|
||||||
|
hash = lib.mkOption { type = lib.types.str; };
|
||||||
|
skill = lib.mkOption { type = lib.types.str; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
|
options.ai-tools = {
|
||||||
|
claude-code = {
|
||||||
|
enable = lib.mkEnableOption "claude code with rtk and ccline";
|
||||||
|
skills = lib.mkOption {
|
||||||
|
type = lib.types.listOf skillType;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
opencode = {
|
||||||
|
enable = lib.mkEnableOption "opencode";
|
||||||
|
};
|
||||||
|
tirith = {
|
||||||
|
enable = lib.mkEnableOption "tirith";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./claude-code.nix
|
./claude-code.nix
|
||||||
./opencode.nix
|
./opencode.nix
|
||||||
|
|||||||
@@ -8,10 +8,6 @@ let
|
|||||||
cfg = config.ai-tools.opencode;
|
cfg = config.ai-tools.opencode;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.ai-tools.opencode = {
|
|
||||||
enable = lib.mkEnableOption "opencode";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
home.packages = [ pkgs.opencode ];
|
home.packages = [ pkgs.opencode ];
|
||||||
|
|
||||||
|
|||||||
@@ -7,16 +7,6 @@
|
|||||||
let
|
let
|
||||||
cfg = config.ai-tools.claude-code;
|
cfg = config.ai-tools.claude-code;
|
||||||
|
|
||||||
skillType = lib.types.submodule {
|
|
||||||
options = {
|
|
||||||
owner = lib.mkOption { type = lib.types.str; };
|
|
||||||
repo = lib.mkOption { type = lib.types.str; };
|
|
||||||
rev = lib.mkOption { type = lib.types.str; };
|
|
||||||
hash = lib.mkOption { type = lib.types.str; };
|
|
||||||
skill = lib.mkOption { type = lib.types.str; };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
fetchSkill =
|
fetchSkill =
|
||||||
skill:
|
skill:
|
||||||
let
|
let
|
||||||
@@ -38,11 +28,6 @@ let
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.ai-tools.claude-code.skills = lib.mkOption {
|
|
||||||
type = lib.types.listOf skillType;
|
|
||||||
default = [ ];
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
home.file = builtins.listToAttrs (map fetchSkill cfg.skills);
|
home.file = builtins.listToAttrs (map fetchSkill cfg.skills);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,10 +8,6 @@ let
|
|||||||
cfg = config.ai-tools.tirith;
|
cfg = config.ai-tools.tirith;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.ai-tools.tirith = {
|
|
||||||
enable = lib.mkEnableOption "tirith";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkMerge [
|
config = lib.mkMerge [
|
||||||
(lib.mkIf cfg.enable {
|
(lib.mkIf cfg.enable {
|
||||||
home.packages = [ pkgs.tirith ];
|
home.packages = [ pkgs.tirith ];
|
||||||
|
|||||||
Reference in New Issue
Block a user