New Ollama.nix, the ai.nix did not work out. Added ZED-editor as separate app
This commit is contained in:
+312
-305
File diff suppressed because it is too large
Load Diff
@@ -1645,17 +1645,24 @@ This Home Manager Nix module (ai.nix) installs the Ollama package and configures
|
|||||||
|
|
||||||
let
|
let
|
||||||
ollamaConfPath = flakeRoot + "/assets/conf/apps/ai/ollama/ollama.conf";
|
ollamaConfPath = flakeRoot + "/assets/conf/apps/ai/ollama/ollama.conf";
|
||||||
|
ollamaEnv = builtins.splitLines (builtins.readFile ollamaConfPath);
|
||||||
|
envVars = lib.genAttrs (ollamaEnv) (line: let
|
||||||
|
parts = builtins.splitString "=" line;
|
||||||
|
in
|
||||||
|
if lib.elemAt parts 0 == "" then
|
||||||
|
lib.mkForce {}
|
||||||
|
else
|
||||||
|
lib.mkForce { (lib.elemAt parts 0) = lib.elemAt parts 1; });
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
services.ollama = {
|
services.ollama = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.ollama;
|
package = pkgs.ollama;
|
||||||
environmentFile = ollamaConfPath;
|
environmentVariables = envVars;
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Powermenu
|
** Powermenu
|
||||||
|
|||||||
@@ -2,13 +2,21 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
ollamaConfPath = flakeRoot + "/assets/conf/apps/ai/ollama/ollama.conf";
|
ollamaConfPath = flakeRoot + "/assets/conf/apps/ai/ollama/ollama.conf";
|
||||||
|
ollamaEnv = builtins.splitLines (builtins.readFile ollamaConfPath);
|
||||||
|
envVars = lib.genAttrs (ollamaEnv) (line: let
|
||||||
|
parts = builtins.splitString "=" line;
|
||||||
|
in
|
||||||
|
if lib.elemAt parts 0 == "" then
|
||||||
|
lib.mkForce {}
|
||||||
|
else
|
||||||
|
lib.mkForce { (lib.elemAt parts 0) = lib.elemAt parts 1; });
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
services.ollama = {
|
services.ollama = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.ollama;
|
package = pkgs.ollama;
|
||||||
environmentFile = ollamaConfPath;
|
environmentVariables = envVars;
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user