(in-package #:lispsearch)

;;;; Configuration specials. All overridable at runtime (and later via CLI).

(defparameter *catalog-url*
  "https://raw.githubusercontent.com/ocicl/request-system-additions-here/main/all-ocicl-systems.txt"
  "Authoritative newline-delimited list of every ocicl system (one per line).")

(defparameter *registry* "ghcr.io/ocicl"
  "OCI registry + namespace used for `ocicl list` / `oras pull`. Pass explicitly
because the environment default may be overridden to a private mirror.")

(defparameter *jobs* 8
  "Default parallelism for enrichment.")

(defparameter *http-timeout* 30
  "Per-request HTTP timeout, in seconds.")

(defun default-db-path ()
  "$XDG_DATA_HOME/lispsearch/index.db, falling back to ~/.local/share/..."
  (let ((xdg (uiop:getenv "XDG_DATA_HOME")))
    (merge-pathnames
     "lispsearch/index.db"
     (uiop:ensure-directory-pathname
      (if (and xdg (plusp (length xdg)))
          xdg
          (merge-pathnames ".local/share/" (user-homedir-pathname)))))))

(defparameter *db-path* (default-db-path)
  "Path to the SQLite index database. Overridable with --db.")
