configs/emacs: add ollama wrapper

This commit is contained in:
Aaron Bieber 2024-07-12 08:39:40 -06:00
parent 4b3cb69462
commit 551118f50e
No known key found for this signature in database
3 changed files with 34 additions and 0 deletions

View File

@ -11,4 +11,11 @@ emacsWithPackagesFromUsePackage {
defaultInitFile = true;
package = emacsPkg;
override = epkgs: epkgs // {
ollama = pkgs.callPackage ../pkgs/ollama-el.nix {
inherit (pkgs) fetchFromGitHub;
inherit (epkgs) trivialBuild;
};
};
}

View File

@ -123,6 +123,19 @@ here.
* Packages
** ollama
Simple wrapper for ~ollama~ that lets me pipe regions and what not into various buffers.
#+begin_src emacs-lisp
(use-package ollama
:init
(setopt
ollama:endpoint "https://ollama.otter-alligator.ts.net/api/generate"
ollama:language "English"
ollama:model "llama3"))
#+end_src
** web-mode
#+begin_src emacs-lisp

14
pkgs/ollama-el.nix Normal file
View File

@ -0,0 +1,14 @@
{ trivialBuild
, fetchFromGitHub
, ...
}:
trivialBuild {
pname = "ollama";
version = "unstable-2023-08-28";
src = fetchFromGitHub {
owner = "zweifisch";
repo = "ollama";
rev = "19e8babd6eceef37ca4bf9a58bc666d0e55b70c6";
hash = "sha256-u3+V7bLH/l2hcVoSdQYsQNKDpz4pwPFjAn1ED8vSk50=";
};
}