41 lines
1.1 KiB
Nix
41 lines
1.1 KiB
Nix
{ config, pkgs, ... }:
|
|
|
|
{
|
|
services.ollama = {
|
|
enable = true;
|
|
package = pkgs.ollama; # Ensure you have ollama in your available packages
|
|
|
|
# Optional: Specify a custom Ollama configuration directory
|
|
# configDir = "/opt/ollama/config";
|
|
|
|
# Optional: Ollama arguments (e.g., for port binding, etc.)
|
|
#extraArgs = [ "--port" "8000" ]; # Example: bind to port 8000
|
|
|
|
# Use a wrapper script to handle initialization. This is important for
|
|
# things like setting environment variables or running initial pulls.
|
|
serviceScript = ''
|
|
#! /bin/sh
|
|
# Wrapper script for Ollama service
|
|
|
|
set -e
|
|
|
|
# Set environment variables if needed
|
|
# export MY_VARIABLE="some_value"
|
|
|
|
# Initial pull if desired (only run once at startup)
|
|
# if [ ! -d "/opt/ollama/models" ]; then
|
|
# ollama pull llama2:7b
|
|
# fi
|
|
|
|
ollama server &
|
|
#ollama serve & # Older versions of ollama used this
|
|
'';
|
|
};
|
|
services.obs = {
|
|
enable = true;
|
|
package = pkgs.obs-studio; # Ensure you have ollama in your available packages
|
|
extraArgs = [ "--startreplaybuffer" "--disable-shutdown-check" ];
|
|
};
|
|
|
|
}
|