feat: more AI-related tools
This commit is contained in:
18
users/modules/dev/ai/claude.nix
Normal file
18
users/modules/dev/ai/claude.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
inputs,
|
||||
system,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.home.dev.ai.claude;
|
||||
in {
|
||||
options.home.dev.ai.claude.enable = mkEnableOption "Enables Claude-related packages";
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [inputs.claude-desktop.packages.${system}.claude-desktop-with-fhs];
|
||||
programs.claude-code = {
|
||||
inherit (cfg) enable;
|
||||
};
|
||||
};
|
||||
}
|
||||
19
users/modules/dev/ai/default.nix
Normal file
19
users/modules/dev/ai/default.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.home.dev.ai;
|
||||
in {
|
||||
imports = [
|
||||
./ollama.nix
|
||||
./claude.nix
|
||||
];
|
||||
|
||||
options.home.dev.ai.enable = mkEnableOption "Enables AI features";
|
||||
config.home.dev.ai = mkIf cfg.enable {
|
||||
ollama.enable = mkDefault cfg.enable;
|
||||
claude.enable = mkDefault cfg.enable;
|
||||
};
|
||||
}
|
||||
@@ -4,20 +4,21 @@
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.home.dev.ollama;
|
||||
cfg = config.home.dev.ai.ollama;
|
||||
in {
|
||||
options.home.dev.ollama = {
|
||||
options.home.dev.ai.ollama = {
|
||||
enable = mkEnableOption "Enables Ollama";
|
||||
gpu = mkOption {
|
||||
type = types.nullOr types.enum ["none" "amd" "nvidia"];
|
||||
example = "amd";
|
||||
default = "none";
|
||||
type = types.nullOr (types.enum [false "rocm" "cuda"]);
|
||||
example = "rocm";
|
||||
default = null;
|
||||
description = "Which type of GPU should be used for hardware acceleration";
|
||||
};
|
||||
};
|
||||
|
||||
config.services.ollama = mkIf cfg.enable {
|
||||
inherit (cfg) enable;
|
||||
acceleration = cfg.gpu;
|
||||
environmentVariables = {
|
||||
OLLAMA_CONTEXT_LENGTH = "8192";
|
||||
};
|
||||
@@ -7,8 +7,8 @@ with lib; let
|
||||
cfg = config.home.dev;
|
||||
in {
|
||||
imports = [
|
||||
./ai
|
||||
./editors
|
||||
./ollama.nix
|
||||
./vcs
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user