1
1
Fork 0

ollama: add server option

This commit is contained in:
Myned 2025-03-31 16:47:53 -05:00
parent 396b389cbc
commit d4d0aa68c4
Signed by: Myned
GPG key ID: C7224454F7881A34
3 changed files with 27 additions and 11 deletions
options/custom
programs/zed
services
profiles/laptop

View file

@ -146,17 +146,6 @@ in {
# https://zed.dev/docs/configuring-zed # https://zed.dev/docs/configuring-zed
userSettings = { userSettings = {
always_treat_brackets_as_autoclosed = true; always_treat_brackets_as_autoclosed = true;
assistant = {
default_model = {
model = "gemma3:1b";
provider = "ollama";
};
default_width = 500;
version = "2";
};
auto_install_extensions = false; auto_install_extensions = false;
auto_signature_help = true; auto_signature_help = true;
base_keymap = "VSCode"; base_keymap = "VSCode";
@ -273,6 +262,22 @@ in {
}; };
}; };
# Language models
# https://zed.dev/docs/assistant/assistant
assistant = {
default_model = {
model = "codegemma:7b";
provider = "ollama";
};
default_width = 500;
version = "2";
};
language_models = {
api_url = "http://${config.custom.services.ollama.server}:11434";
};
# TODO: Add missing syntax in highlights.scm # TODO: Add missing syntax in highlights.scm
# Theme overrides # Theme overrides
# https://zed.dev/docs/themes#theme-overrides # https://zed.dev/docs/themes#theme-overrides

View file

@ -8,6 +8,13 @@ with lib; let
in { in {
options.custom.services.ollama = { options.custom.services.ollama = {
enable = mkOption {default = false;}; enable = mkOption {default = false;};
server = mkOption {
default =
if config.custom.full
then "localhost"
else "mynix";
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -1,11 +1,15 @@
{ {
custom = { custom = {
full = true; full = true;
# FIXME: Use "laptop" profile
profile = "desktop"; # Inherit desktop profile profile = "desktop"; # Inherit desktop profile
desktop = "niri"; desktop = "niri";
services = { services = {
#// auto-cpufreq.enable = true; #// auto-cpufreq.enable = true;
ollama.server = "mynix";
power-profiles-daemon = { power-profiles-daemon = {
enable = true; enable = true;