diff options
author | azahi <azat@bahawi.net> | 2024-11-17 18:21:17 +0300 |
---|---|---|
committer | azahi <azat@bahawi.net> | 2024-11-17 18:21:17 +0300 |
commit | fc2e6a3a6b568d5ae1004723ea54c123af7e9242 (patch) | |
tree | 5adf2a7741c6ee319833fe6079f9958961ef56b5 /configurations/eonwe/ollama.nix | |
parent | 2024-11-10 (diff) |
Diffstat (limited to '')
-rw-r--r-- | configurations/eonwe/ollama.nix | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/configurations/eonwe/ollama.nix b/configurations/eonwe/ollama.nix new file mode 100644 index 0000000..a98fb3f --- /dev/null +++ b/configurations/eonwe/ollama.nix @@ -0,0 +1,68 @@ +{ + config, + lib, + ... +}: + +{ + ark.directories = [ config.services.ollama.home ]; + + hm.programs.firefox.profiles.default.bookmarks = [ + { + name = "Bookmarks Toolbar"; + toolbar = true; + bookmarks = [ + { + name = "Ollama"; + url = "http://127.0.0.1:11435"; + } + ]; + } + ]; + + services = { + ollama = { + enable = true; + + host = "0.0.0.0"; + port = 11434; + + user = "ollama"; + group = "ollama"; + + acceleration = "rocm"; + rocmOverrideGfx = "10.3.0"; + + environmentVariables.OLLAMA_ORIGINS = lib.concatStringsSep "," [ + "http://127.0.0.1:11435" + "http://eonwe.shire.net:11435" + "http://eonwe:11435" + "http://localhost:11435" + ]; + + openFirewall = true; + }; + + nextjs-ollama-llm-ui = { + enable = true; + + hostname = "0.0.0.0"; + port = 11435; + + ollamaUrl = "http://127.0.0.1:11434"; + }; + }; + + systemd.services = { + ollama = { + serviceConfig = { + StateDirectory = lib.mkForce config.services.ollama.home; + DynamicUser = lib.mkForce false; + User = config.services.ollama.user; + Group = config.services.ollama.group; + }; + }; + + nextjs-ollama-llm-ui.serviceConfig.CacheDirectory = "nextjs-ollama-llm-ui"; + }; +} |