Add gptel to Emacs desktop profile

This commit is contained in:
Fabio Scotto di Santolo
2026-04-09 22:28:33 +02:00
parent 9659fcce23
commit 1c23326fd5
8 changed files with 76 additions and 35 deletions

View File

@@ -268,6 +268,9 @@
- src: desktop/email.el.j2
dest: .emacs.d/lisp/misc/email.el
mode: "0644"
- src: desktop/gptel-private.el.j2
dest: .emacs.d/lisp/misc/gptel-private.el
mode: "0600"
loop_control:
label: "{{ item.dest }}"

View File

@@ -0,0 +1,7 @@
;;; gptel-private.el -*- lexical-binding: t; -*-
(let ((openai-api-key "{{ vault_openai_api_key | default('') }}"))
(when (> (length openai-api-key) 0)
(setq gptel-api-key openai-api-key)))
;;; gptel-private.el ends here

View File

@@ -31,15 +31,16 @@
'lang/shell
'lang/yaml
;; Misc
'misc/dashboard
'misc/custom-functions
'misc/doom-modeline
'misc/which-key
'misc/email
'misc/rss
'misc/terminal
'misc/vcs
;; Misc
'misc/dashboard
'misc/custom-functions
'misc/doom-modeline
'misc/which-key
'misc/gptel
'misc/email
'misc/rss
'misc/terminal
'misc/vcs
;; FIXME PDF viewer with annotations
;; 'misc/pdf
'misc/epub

View File

@@ -57,6 +57,10 @@
(autoload 'elfeed "elfeed" nil t)
(define-key fscotto/open (kbd "f") #'elfeed)
;; -------- gptel --------
(autoload 'gptel "gptel" nil t)
(define-key fscotto/open (kbd "l") #'gptel)
;;;; Elfeed mode maps
(with-eval-after-load 'elfeed
(define-key elfeed-search-mode-map (kbd "w") #'elfeed-search-yank)

View File

@@ -0,0 +1,14 @@
;;; gptel.el -*- lexical-binding: t; -*-
(use-package gptel
:ensure t
:commands (gptel gptel-send gptel-rewrite)
:config
(let ((private-config
(expand-file-name "lisp/misc/gptel-private.el" user-emacs-directory)))
(when (file-readable-p private-config)
(load private-config nil 'nomessage))))
(provide 'fscotto-gptel)
;;; gptel.el ends here

View File

@@ -31,6 +31,7 @@
;; --------------------------------------------------------------------------
(which-key-add-key-based-replacements
"C-c o f" "RSS (Elfeed)"
"C-c o l" "LLM chat (gptel)"
"C-c o m" "mu4e (Email Client)"
"C-c o T" "Terminal (vterm)")

View File

@@ -1,27 +1,37 @@
$ANSIBLE_VAULT;1.1;AES256
31353463393335373839323166383061646166326234303634356165653063666264333764303434
3861656431316234653461663763393561326266306630640a393833306630333538303134643963
34383461383830396132656634613238616330363633323537653262653934386232386133376437
6264396638333761390a336436366261393132333036663737313837373635646333363530633263
30326562343236366131393062356264326366643934366561333036333630346536663536333838
37333231376138666463363966396332303430343035643437326464613439643933636637343030
33393230333062333365633661313832393431643932323338373637636462376338386634353137
30626662356461616638383463643765623461616564353766396531326232616536626265366634
61346566396532313038653963333933336166303263616535646538336333633064343062366638
37376539653863613830323231633632613732396362363764316362636662313766613437313332
37643336393934346131323432663164313233346363643263663066663235623534663139373361
34346538363735383063656265336431303535376136373032386565663633643830653063303264
39636132373834396631396535376666646366303464393535336662616566346635356263353533
61656635373837333633623737383533383063343235383631373333386363323362393563376666
65656430336564323231663237643035333864303331303565376231386630303435393530653961
61663964636539643738303966636237323038613539616137373538623962396662366337366238
64376337303831306533646231643565306632333363653262306435353136653161346664636338
63396130393832303933363262393166373931343163366363396238376165636464346636663263
35303837333830326138663330366662373535623566323765343232363030646262363764323730
30613764333261646563333630626638366664363638666335363465326362323832306565356339
35636339623738386232343235643361646364303934663533323135353039663762623839393038
30613363366461386665316430353238613766396665383765663165343263313937383433343162
37643166383539373061653865316163633264653730386337313232653139383632366666313862
39343335656665373964313835323636393665393631616139656534323866663362393030336466
34373938326633323834613833613861313063396131633763303065303665343363346133616335
3035393738356630623161383734653364343965383733356131
36346638633530653262306466326434346237313965643039643837623233313037363163346338
3165386461353334393464616362333033613231313865340a313731623439626633303566333239
63363166666663376365613034643663373937613162643935366333313438373365346539663161
6663343762336130350a306336613962353931306230363564626538346163623936363064383964
61333734633635326630383339306539643537316665666666643533333364613030613265313032
62643363383464303836376266633962313666396630313361303039343133316237643164616666
30376433323330363033643231643861383234336362383432633665313566336537633631303133
66656363613165333666383432623435626339666364643936653037663839643262393664653564
37373465373663376537616532656434316435623734656265363536336333633537626435303635
65623036613631386464646335653862396232326163623130396133643935363135393934333638
37626664353131613336353130366566383238623031636366333036643161626564613965613233
63336138393161306565623466383763663664323864633430626561313939336434363462656361
33343433636562653138613233343030333362383661633536616564313662353231343966386466
63633032643432343337303131656465373039646235653335353239633865353533626632336366
32386430623035626533346463333230663735353632356530643635386336393235646461303064
37316265613233303537373631613265636435343631363930323234366332613966346262336531
36646566393036636363333733613433353561363639616139626331336234353334303739643061
32333062383164373435666166386263663438666364636239383731313863386361363035313333
30656363306565623035303462363637353839343665393934613733613532313237613134313466
61336335616631666430393364363864306632663462393733656539386431313864333265393265
33626630643863306632363835353238376631626335313566666264343664656136316337376432
36653534336232303361663966663366343637663432316533643766636339313339643430336531
34303430336333663364306432363461326465396533376263336131323639393737666632623363
36656438616230663566633061383135633937613530346636396630656135663639396235373965
31396536376666333839336166653734303362633263643039353838393431393463303337313263
62653036346666393930646536653235326566303465333666646534643935663734643063613762
63336334646336343537386133383138363932616662376131393530633565353935613566306563
30643338613065393731623534656431373235353837383963383262323939343061326531303536
38303731633265376334393465656334353265656633336231326636636339626461616533323533
39326663336431353633313265353736356435393761613163386665623865346132333537666336
32366564363739386339343835393966623161656165643232643535616536633762666530623466
63636336386563373032663939373237383639623938616336653235663430613863616537326666
65346464326138646435353033303831383732623133393666663533303564613835323334333632
65366138613266313261646134303165333265366134373362333433653734653038646538363566
31373137643331373734353038643833333966663161633561653533333338353230393838336434
35346533356463666466

View File

@@ -6,6 +6,7 @@ vault_icloud_email: "REPLACE_ME"
vault_protonmail_email: "REPLACE_ME"
vault_icloud_mail_password: "REPLACE_ME"
vault_git_work_email: "REPLACE_ME"
vault_openai_api_key: "REPLACE_ME"
vault_windows_psrp_host: "REPLACE_ME"
vault_windows_psrp_user: 'MicrosoftAccount\user@example.com'
vault_windows_psrp_password: "REPLACE_ME"