New Ollama.nix, the ai.nix did not work out. Added ZED-editor as separate app

This commit is contained in:
2026-02-28 14:48:27 +01:00
parent fd05e142c4
commit 60de75da07
2 changed files with 321 additions and 312 deletions
+314 -309
View File
File diff suppressed because it is too large Load Diff
+7 -3
View File
@@ -1,13 +1,15 @@
{ lib, config, pkgs, flakeRoot,... }:
{ lib, config, pkgs, flakeRoot, ... }:
let
# Path to the config file (relative to your flake or Home Manager root)
ollamaConfPath = flakeRoot + "/assets/conf/apps/ai/ollama/ollama.conf";
# Read and parse the config file (assuming it's in shell variable format)
ollamaConf = builtins.readFile ollamaConfPath;
# Extract values using regex (adjust if your format differs)
extractValue = key: builtins.match
("(?m)^${key}=\"([^\"]+)\"$" + ollamaConf)
"";
("(?m)^${key}=\"([^\"]+)\"$")
ollamaConf;
ollamaHost = extractValue "OLLAMA_HOST";
ollamaDefaultModel = extractValue "OLLAMA_DEFAULT_MODEL";
in
@@ -16,11 +18,13 @@ in
home.packages = with pkgs; [
ollama
];
# Configure Ollama environment variables
home.sessionVariables = {
OLLAMA_HOST = if ollamaHost != "" then ollamaHost else "http://127.0.0.1:11434";
OLAMA_DEFAULT_MODEL = if ollamaDefaultModel != "" then ollamaDefaultModel else "codellama:70b";
};
# Optional: Start Ollama service (if using NixOS)
systemd.user.services.ollama = {
description = "Ollama service";