Adapted path to conf file
This commit is contained in:
@@ -1641,10 +1641,10 @@ This module will import all necessities.
|
|||||||
This Home Manager Nix module (ai.nix) installs the Ollama package and configures it by reading a simple key-value configuration file (ollama.conf) for settings like the server host and default model. It sets environment variables (OLLAMA_HOST and OLAMA_DEFAULT_MODEL) for easy access in your shell or applications, with fallback defaults if the config file is missing or empty. Optionally, it also defines a user-level systemd service to automatically start the Ollama server on NixOS or systems with Home Manager’s systemd support enabled.
|
This Home Manager Nix module (ai.nix) installs the Ollama package and configures it by reading a simple key-value configuration file (ollama.conf) for settings like the server host and default model. It sets environment variables (OLLAMA_HOST and OLAMA_DEFAULT_MODEL) for easy access in your shell or applications, with fallback defaults if the config file is missing or empty. Optionally, it also defines a user-level systemd service to automatically start the Ollama server on NixOS or systems with Home Manager’s systemd support enabled.
|
||||||
|
|
||||||
#+begin_src nix :tangle home/apps/ollama.nix :noweb tangle :mkdirp yes
|
#+begin_src nix :tangle home/apps/ollama.nix :noweb tangle :mkdirp yes
|
||||||
{ lib, config, pkgs, ... }:
|
{ lib, config, pkgs, flakeRoot,... }:
|
||||||
let
|
let
|
||||||
# Path to the config file (relative to your flake or Home Manager root)
|
# Path to the config file (relative to your flake or Home Manager root)
|
||||||
ollamaConfPath = ./assets/conf/apps/ai/ollama/ollama.conf;
|
ollamaConfPath = flakeRoot + "/assets/conf/apps/ai/ollama/ollama.conf";
|
||||||
# Read and parse the config file (assuming it's in shell variable format)
|
# Read and parse the config file (assuming it's in shell variable format)
|
||||||
ollamaConf = builtins.readFile ollamaConfPath;
|
ollamaConf = builtins.readFile ollamaConfPath;
|
||||||
# Extract values using regex (adjust if your format differs)
|
# Extract values using regex (adjust if your format differs)
|
||||||
|
|||||||
Reference in New Issue
Block a user