From d0e16f75f7055c2833322851f13f30dda9e9bc4e Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Sun, 6 Apr 2025 17:21:17 +0200 Subject: [PATCH 1/6] Sign git commits with `id_ed25519` instead of `id_rsa` --- hmModules/git/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hmModules/git/default.nix b/hmModules/git/default.nix index d040d53..5544eb1 100644 --- a/hmModules/git/default.nix +++ b/hmModules/git/default.nix @@ -27,11 +27,11 @@ in rebase.autostash = true; github.user = "aciceri"; - user.signingKey = "/home/${username}/.ssh/id_rsa"; + user.signingKey = "/home/${username}/.ssh/id_ed25519"; gpg.format = "ssh"; commit.gpgsign = true; - credential.helper = "manager"; + credential.helper = "libsecret"; credential.credentialStore = "cache"; core = { From f546beea17343fa2b9708e4722952c8f463b4241 Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Sun, 6 Apr 2025 17:21:45 +0200 Subject: [PATCH 2/6] Use `meow-tree-sitter` --- hmModules/emacs/init.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hmModules/emacs/init.el b/hmModules/emacs/init.el index 9b685a3..bf1bfc5 100644 --- a/hmModules/emacs/init.el +++ b/hmModules/emacs/init.el @@ -214,6 +214,8 @@ :custom (meow-use-clipboard 't) :config + (require 'meow-tree-sitter) + (meow-tree-sitter-register-defaults) (add-hook 'after-make-frame-functions (defun ccr/meow--prepare-face (_) (meow--prepare-face) (remove-hook 'after-make-frame-functions 'ccr/meow--prepare-face))) From 8f73eca4042d15719b12791551a4d1a38ce1575c Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Sun, 6 Apr 2025 17:21:58 +0200 Subject: [PATCH 3/6] Disable `eshell-atuin` --- hmModules/emacs/init.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hmModules/emacs/init.el b/hmModules/emacs/init.el index bf1bfc5..557648b 100644 --- a/hmModules/emacs/init.el +++ b/hmModules/emacs/init.el @@ -700,8 +700,8 @@ :custom ((eshell-command-not-found-command "command-not-found")) :hook ((eshell-mode . eshell-command-not-found-mode))) -(use-package eshell-atuin - :hook ((eshell-mode . eshell-atuin-mode))) +;; (use-package eshell-atuin +;; :hook ((eshell-mode . eshell-atuin-mode))) (use-package eshell-syntax-highlighting :custom From dc30a6a4377d9e0f003f1f8fd63621dadb5836c0 Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Sun, 6 Apr 2025 17:22:11 +0200 Subject: [PATCH 4/6] `gptel` shortcuts --- hmModules/emacs/init.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hmModules/emacs/init.el b/hmModules/emacs/init.el index 557648b..8148788 100644 --- a/hmModules/emacs/init.el +++ b/hmModules/emacs/init.el @@ -993,6 +993,10 @@ This is meant to be an helper to be called from the window manager." ) (gptel-default-mode 'org-mode) (gptel-org-branching-context nil) ;; this is cool but I don't feel comfortable with it + ("C-c a a" . gptel-add) + ("C-c a f" . gptel-add-file) + ("C-c a r" . gptel-context-remove-all) + ("C-c a " . gptel-menu) :config (require 'gptel-curl) From b58c3c4d31e3f90506d6dc5b15d5a0ce9599f34e Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Sun, 6 Apr 2025 17:22:19 +0200 Subject: [PATCH 5/6] Use `gemini` --- hmModules/emacs/init.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hmModules/emacs/init.el b/hmModules/emacs/init.el index 8148788..c53aedc 100644 --- a/hmModules/emacs/init.el +++ b/hmModules/emacs/init.el @@ -983,16 +983,17 @@ This is meant to be an helper to be called from the window manager." (use-package gptel :custom - (gptel-model 'qwen/qwen-max) + (gptel-model 'google/gemini-2.0-flash-001) (gptel-backend (gptel-make-openai "OpenRouter" :host "openrouter.ai" :endpoint "/api/v1/chat/completions" :key (lambda () (require 'f) (f-read-text (getenv "OPENAI_API_KEY_PATH"))) :stream t - :models '(qwen/qwen-max deepseek/deepseek-chat)) + :models '(google/gemini-2.0-flash-001)) ) (gptel-default-mode 'org-mode) (gptel-org-branching-context nil) ;; this is cool but I don't feel comfortable with it + :bind ("C-c a a" . gptel-add) ("C-c a f" . gptel-add-file) ("C-c a r" . gptel-context-remove-all) From 61d9355c0ef277b65d057cf55876cdbb6eee7a91 Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Sun, 6 Apr 2025 17:23:26 +0200 Subject: [PATCH 6/6] Use `gptel` tools --- hmModules/emacs/init.el | 55 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/hmModules/emacs/init.el b/hmModules/emacs/init.el index c53aedc..3c501c7 100644 --- a/hmModules/emacs/init.el +++ b/hmModules/emacs/init.el @@ -993,17 +993,72 @@ This is meant to be an helper to be called from the window manager." ) (gptel-default-mode 'org-mode) (gptel-org-branching-context nil) ;; this is cool but I don't feel comfortable with it + (gptel-use-tools 't) + :bind ("C-c a a" . gptel-add) ("C-c a f" . gptel-add-file) ("C-c a r" . gptel-context-remove-all) ("C-c a " . gptel-menu) + + :config (require 'gptel-curl) ;; (add-hook 'gptel-post-response-functions 'gptel-end-of-response) ;; (add-hook 'gptel-post-stream-hook 'gptel-auto-scroll) + (setq gptel-tools (mapcar (lambda (tool) (apply #'gptel-make-tool tool)) + '(( + :name "create_file" + :function (lambda (path filename content) + (let ((full-path (expand-file-name filename path))) + (with-temp-buffer + (insert content) + (write-file full-path)) + (format-read "Created file %s in %s" filename path))) + :description "Create a new file with the specified content" + :args (list '(:name "path" + :type string + :description "The directory where to create the file") + '(:name "filename" + :type string + :description "The name of the file to create") + '(:name "content" + :type string + :description "The content to write to the file")) + :category "filesystem" + ) + ( + :name "run_command" + :confirm 't + :function (lambda (command) + (shell-command-to-string command)) + :description "Run arbitrary commands" + :args (list '(:name "command" + :type string + :description "The content to run e.g. 'ls *' or 'fd '")) + ) + ( + :name "get_weather" + :function (lambda (location) + (url-retrieve-synchronously "api.weather.com/..." + location unit)) + :description "Get the current weather in a given location" + :args (list '(:name "location" + :type string + :description "The city and state, e.g. San Francisco, CA") + '(:name "unit" + :type string + :enum ["celsius" "farenheit"] + :description + "The unit of temperature, either 'celsius' or 'fahrenheit" + :optional t + )) + ) + )) + ) + (defun ccr/suggest-eshell-command () (interactive) (save-excursion