#!/usr/bin/env bash

# omarchy:summary=Install Ollama, the local model server
# omarchy:requires-sudo=true

# Based: Debian carries no ollama package, so the vendor's install script
# puts the binary and its service in place, as the former dev tooling did.
# On macOS the Ollama app carries the server and links the CLI itself.

set -eo pipefail

echo "Installing Ollama..."

case $(omarchy-os) in
darwin)
  omarchy-pkg-add ollama cask=ollama-app
  ;;
*)
  if omarchy-cmd-missing ollama; then
    curl -fsSL https://ollama.com/install.sh | sudo sh
  fi
  ;;
esac
