commit bbf242dd9cfa191f6e01edf17a430e0fed145221
parent 91e6c3225bf781393e8be3ceac182ca9722410a6
Author: Chris <chris@echoz.io>
Date: Fri, 28 Aug 2026 06:25:45 +0200
feat: add opencode and ollama
Diffstat:
2 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/modules/ollama/default.nix b/modules/ollama/default.nix
@@ -0,0 +1,12 @@
+{ user, pkgs, ... }: {
+ home-manager.users.${user}.services.ollama = {
+ enable = true;
+ package = pkgs.ollama-vulkan;
+ environmentVariables = {
+ OLLAMA_CONTEXT_LENGTH = toString (256 * 1024);
+ OLLAMA_KEEP_ALIVE = "150";
+ };
+ };
+
+ environment.persistence."/fix".users.${user}.directories = [ ".ollama/models" ];
+}
diff --git a/modules/opencode/default.nix b/modules/opencode/default.nix
@@ -0,0 +1,42 @@
+{ user, ... }: {
+ home-manager.users.${user}.programs.opencode = {
+ enable = true;
+ settings = {
+ autoupdate = false;
+ share = "disabled";
+ permission."*" = "ask";
+ model = "ollama/gpt-oss:20b";
+ enabled_providers = [ "ollama" ];
+ provider.ollama = {
+ name = "Ollama";
+ npm = "@ai-sdk/openai-compatible";
+ options.baseURL = "http://127.0.0.1:11434/v1";
+ models = {
+ "qwen3-coder:30b".limit = {
+ context = 256 * 1024;
+ input = 128 * 1024;
+ output = 8 * 1024;
+ };
+ "gpt-oss:20b" = {
+ limit = {
+ context = 128 * 1024;
+ input = 64 * 1024;
+ output = 8 * 1024;
+ };
+ options.extraBody.think = "high";
+ };
+ "qwen3.5:27b".limit = {
+ context = 256 * 1024;
+ input = 128 * 1024;
+ output = 8 * 1024;
+ };
+ "qwen3.6:27b".limit = {
+ context = 256 * 1024;
+ input = 128 * 1024;
+ output = 8 * 1024;
+ };
+ };
+ };
+ };
+ };
+}