guix-epistemia

Personal Guix channel
Log | Files | Refs

emacs.scm (12521B)


      1 (define-module (epistemia packages emacs)
      2   #:use-module (guix packages)
      3   #:use-module (guix download)
      4   #:use-module (guix git-download)
      5   #:use-module (guix build-system emacs)
      6   #:use-module ((guix licenses) :prefix license:)
      7   #:use-module (gnu packages emacs-build)
      8   #:use-module (gnu packages emacs-xyz)
      9   #:use-module (gnu packages golang-crypto))
     10 
     11 (define-public emacs-kaolin-themes
     12   (package
     13     (name "emacs-kaolin-themes")
     14     (version "1.7.4")
     15     (source
     16      (origin
     17        (method git-fetch)
     18        (uri (git-reference
     19               (url "https://github.com/ogdenwebb/emacs-kaolin-themes")
     20               (commit (string-append "v" version))))
     21        (file-name (git-file-name name version))
     22        (sha256
     23         (base32 "1lbqvs2jqvs6x8gj7bali24mw2fl6gk184zln6avy6wmam7n8dqi"))))
     24     (build-system emacs-build-system)
     25     (propagated-inputs (list emacs-autothemer))
     26     (arguments
     27      '(#:include '("^[^/]*.el$" "^[^/]*.el.in$"
     28                    "^dir$"
     29                    "^[^/]*.info$"
     30                    "^[^/]*.texi$"
     31                    "^[^/]*.texinfo$"
     32                    "^doc/dir$"
     33                    "^doc/[^/]*.info$"
     34                    "^doc/[^/]*.texi$"
     35                    "^doc/[^/]*.texinfo$"
     36                    "^themes/[^/]*.el$")
     37        #:exclude '("^.dir-locals.el$" "^test.el$" "^tests.el$"
     38                    "^[^/]*-test.el$" "^[^/]*-tests.el$")))
     39     (home-page "https://github.com/ogdenwebb/emacs-kaolin-themes")
     40     (synopsis "A set of eye pleasing themes")
     41     (description
     42      "Kaolin is a set of eye pleasing themes for GNU Emacs With support a large number
     43 of modes and external packages.  Kaolin themes are based on the pallete that was
     44 originally inspired by Sierra.vim with adding some extra colors. ------- This
     45 package includes the following themes ------- * kaolin-dark - a dark jade
     46 variant inspired by Sierra.vim. * kaolin-light - light variant of the original
     47 kaolin-dark. * kaolin-aurora - Kaolin meets polar lights. * kaolin-bubblegum -
     48 Kaolin colorful theme with dark blue background. * kaolin-eclipse - a dark
     49 purple variant. * kaolin-galaxy - bright theme based on one of the Sebastian
     50 Andaur arts. * kaolin-mono-dark - almost monochrome dark green Kaolin theme. *
     51 kaolin-mono-light - light variant of monochrome theme. * kaolin-ocean - dark
     52 blue variant. * kaolin-shiva - theme with autumn colors and melanzane
     53 background. * kaolin-temple - dark brown background with syntax highlighting
     54 based on orange and cyan shades. * kaolin-valley-dark - colorful Kaolin theme
     55 with brown background. * kaolin-valley-light - light version of
     56 kaolin-valley-dark theme. ------- Configuration example ------- (require
     57 kaolin-themes) (load-theme kaolin-dark t) ;; Apply treemacs customization for
     58 Kaolin themes, requires the all-the-icons package. (kaolin-treemacs-theme) ;; Or
     59 if you have use-package installed (use-package kaolin-themes :config (load-theme
     60 kaolin-dark t) (kaolin-treemacs-theme)) ;; Custom theme settings ;; The
     61 following set to t by default (setq kaolin-themes-bold t ; If nil, disable the
     62 bold style.  kaolin-themes-italic t ; If nil, disable the italic style.
     63 kaolin-themes-underline t) ; If nil, disable the underline style. ------- Some
     64 extra theme features, disabled by default ------- ;; If t, use the wave
     65 underline style instead of regular underline. (setq kaolin-themes-underline-wave
     66 t) ;; When t, will display colored hl-line style (setq
     67 kaolin-themes-hl-line-colored t).")
     68     (license license:gpl3)))
     69 
     70 (define-public emacs-gptel-new
     71   (package
     72     (name "emacs-gptel-new")
     73     (version "20260410.711")
     74     (source
     75      (origin
     76        (method git-fetch)
     77        (uri (git-reference
     78              (url "https://github.com/karthink/gptel")
     79              (commit "8d6411b5f89d796c817ff79324973b8910e164fe")))
     80        (file-name (git-file-name name version))
     81        (sha256
     82         (base32 "0zl5qdp9qqh8chadsp2m3jpbpsxlywdlfkax8p97y73q1yias0q6"))))
     83     (build-system emacs-build-system)
     84     (propagated-inputs (list emacs-transient emacs-compat))
     85     (home-page "https://github.com/karthink/gptel")
     86     (synopsis "Interact with ChatGPT or other LLMs")
     87     (description
     88      "gptel is a simple Large Language Model chat client, with support for multiple
     89 models and backends.  It works in the spirit of Emacs, available at any time and
     90 in any buffer.  gptel supports: - The services @code{ChatGPT}, Azure, Gemini,
     91 Anthropic AI, Together.ai, Perplexity, AI/ML API, Anyscale, @code{OpenRouter},
     92 Groq, @code{PrivateGPT}, @code{DeepSeek}, Cerebras, Github Models, @code{GitHub}
     93 Copilot chat, AWS Bedrock, Novita AI, @code{xAI}, Sambanova, Mistral Le Chat and
     94 Kagi (@code{FastGPT} & Summarizer). - Local models via Ollama, Llama.cpp,
     95 Llamafiles or GPT4All Additionally, any LLM service (local or remote) that
     96 provides an @code{OpenAI-compatible} API is supported.  Features: - Interact
     97 with LLMs from anywhere in Emacs (any buffer, shell, minibuffer, wherever). -
     98 LLM responses are in Markdown or Org markup. - Supports conversations and
     99 multiple independent sessions. - Supports tool-use to equip LLMs with agentic
    100 capabilities. - Supports Model Context Protocol (MCP) integration using the
    101 mcp.el package. - Supports multi-modal models (send images, documents). -
    102 Supports \"reasoning\" content in LLM responses. - Save chats as regular
    103 Markdown/Org/Text files and resume them later. - You can go back and edit your
    104 previous prompts or LLM responses when continuing a conversation.  These will be
    105 fed back to the model. - Redirect prompts and responses easily - Rewrite,
    106 refactor or fill in regions in buffers. - Write your own commands for custom
    107 tasks with a simple API. Requirements for @code{ChatGPT}, Azure, Gemini or Kagi:
    108 - You need an appropriate API key.  Set the variable `gptel-api-key to the key
    109 or to a function of no arguments that returns the key. (It tries to use
    110 `auth-source by default) @code{ChatGPT} is configured out of the box.  For the
    111 other sources: - For Azure: define a gptel-backend with `gptel-make-azure'. -
    112 For Gemini: define a gptel-backend with `gptel-make-gemini'. - For Anthropic
    113 (Claude): define a gptel-backend with `gptel-make-anthropic'. - For AI/ML API,
    114 Together.ai, Anyscale, Groq, @code{OpenRouter}, @code{DeepSeek}, Cerebras or
    115 Github Models: define a gptel-backend with `gptel-make-openai'. - For
    116 @code{PrivateGPT}: define a backend with `gptel-make-privategpt'. - For
    117 Perplexity: define a backend with `gptel-make-perplexity'. - For Deepseek:
    118 define a backend with `gptel-make-deepseek'. - For Kagi: define a gptel-backend
    119 with `gptel-make-kagi'.  For local models using Ollama, Llama.cpp or GPT4All: -
    120 The model has to be running on an accessible address (or localhost) - Define a
    121 gptel-backend with `gptel-make-ollama or `gptel-make-gpt4all'. - Llama.cpp or
    122 Llamafiles: Define a gptel-backend with `gptel-make-openai'.  Consult the
    123 package README for examples and more help with configuring backends.  Usage:
    124 gptel can be used in any buffer or in a dedicated chat buffer.  The interaction
    125 model is simple: Type in a query and the response will be inserted below.  You
    126 can continue the conversation by typing below the response.  To use this in any
    127 buffer: - Call `gptel-send to send the buffer's text up to the cursor.  Select a
    128 region to send only the region. - You can select previous prompts and responses
    129 to continue the conversation. - Call `gptel-send with a prefix argument to
    130 access a menu where you can set your backend, model and other parameters, or to
    131 redirect the prompt/response.  To use this in a dedicated buffer: - M-x gptel:
    132 Start a chat session. - In the chat session: Press `C-c RET (`gptel-send') to
    133 send your prompt.  Use a prefix argument (`C-u C-c RET') to access a menu.  In
    134 this menu you can set chat parameters like the system directives, active backend
    135 or model, or choose to redirect the input or output elsewhere (such as to the
    136 kill ring or the echo area). - You can save this buffer to a file.  When opening
    137 this file, turn on `gptel-mode before editing it to restore the conversation
    138 state and continue chatting. - To include media files with your request, you can
    139 add them to the context (described next), or include them as links in Org or
    140 Markdown mode chat buffers.  Sending media is disabled by default, you can turn
    141 it on globally via `gptel-track-media', or locally in a chat buffer via the
    142 header line.  Include more context with requests: If you want to provide the LLM
    143 with more context, you can add arbitrary regions, buffers, files or directories
    144 to the query with `gptel-add'.  To add text or media files, call `gptel-add in
    145 Dired or use the dedicated `gptel-add-file'.  You can also add context from
    146 gptel's menu instead (`gptel-send with a prefix arg), as well as examine or
    147 modify context.  When context is available, gptel will include it with each LLM
    148 query.  LLM Tool use: gptel supports \"tool calling\" behavior, where LLMs can
    149 specify arguments with which to call provided \"tools\" (elisp functions).  The
    150 results of running the tools are fed back to the LLM, giving it capabilities and
    151 knowledge beyond what is available out of the box.  For example, tools can
    152 perform web searches or API lookups, modify files and directories, and so on.
    153 Tools can be specified via `gptel-make-tool', or obtained from other
    154 repositories, or from Model Context Protocol (MCP) servers using the mcp.el
    155 package.  See the README for details.  Tools can be included with LLM queries
    156 using gptel's menu, or from `gptel-tools'.  Rewrite interface In any buffer:
    157 with a region selected, you can rewrite prose, refactor code or fill in the
    158 region.  This is accessible via `gptel-rewrite', and also from the `gptel-send
    159 menu.  Presets Define a bundle of configuration (model, backend, system message,
    160 tools etc) as a \"preset\" that can be applied together, making it easy to switch
    161 between tasks in gptel.  Presets can be saved and applied from gptel's transient
    162 menu.  You can also include a cookie of the form \"@@preset-name\" in the prompt
    163 to send a request with a preset applied.  This feature works everywhere, but
    164 preset cookies are also fontified in chat buffers.  gptel in Org mode: gptel
    165 offers a few extra conveniences in Org mode: - You can limit the conversation
    166 context to an Org heading with `gptel-org-set-topic'. - You can have branching
    167 conversations in Org mode, where each hierarchical outline path through the
    168 document is a separate conversation branch.  See the variable
    169 `gptel-org-branching-context'. - You can declare the gptel model, backend,
    170 temperature, system message and other parameters as Org properties with the
    171 command `gptel-org-set-properties'.  gptel queries under the corresponding
    172 heading will always use these settings, allowing you to create mostly
    173 reproducible LLM chat notebooks.  Finally, gptel offers a general purpose API
    174 for writing LLM ineractions that suit your workflow.  See `gptel-request', and
    175 `gptel-fsm for more advanced usage.")
    176     (license license:gpl3)))
    177 
    178 (define-public emacs-kasi
    179   (package
    180     (name "emacs-kasi")
    181     (version "1.2")
    182     (source
    183      (origin
    184        (method git-fetch)
    185        (uri (git-reference
    186               (url "https://git.vineetk.net/kasi.el")
    187               (commit (string-append "v" version))))
    188        (file-name (git-file-name name version))
    189        (sha256
    190         (base32 "1fkwq6rg24f5rjbmpyq095msxphb9mkmxg8sh15vr3l50qckvdq5"))))
    191     (build-system emacs-build-system)
    192     (propagated-inputs (list age))
    193     (arguments
    194      '(#:include '("^[^/]*.el$")
    195        #:exclude '("^[^/]*.sh$")))
    196     (home-page "https://git.vineetk.net/kasi.el")
    197     (synopsis "cryptography-agnostic emacs secrets manager")
    198     (description "This package provides an easy way to manage secrets via M-x kasi.")
    199     (license license:gpl3)))
    200 
    201 (define-public emacs-llm-tools
    202   (package
    203    (name "emacs-llm-tools")
    204    (version "1.1")
    205    (source
    206     (origin
    207      (method git-fetch)
    208      (uri (git-reference
    209 	   (url "https://git.vineetk.net/llm-tools.el")
    210 	   (commit (string-append "v" version))))
    211      (file-name (git-file-name name version))
    212      (sha256
    213       (base32 "0zsbrq5syqr35xnlpk6wddjvhy6kcrhdzn67xnba5m3h73zydznx"))))
    214    (build-system emacs-build-system)
    215    (inputs (list emacs-gptel-new
    216 		 emacs-magit))
    217    (arguments
    218     '(#:include '("^[^/]*.el$")
    219       #:exclude '("^[^/]*.sh$")))
    220    (home-page "https://git.vineetk.net/kasi.el")
    221    (synopsis "cryptography-agnostic emacs secrets manager")
    222    (description "This package provides an easy way to manage secrets via M-x kasi.")
    223    (license license:gpl3)))