From b8b0adb37c6e776c87f8f4384a3e3f41ec1af989 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 1 Oct 2025 16:38:42 +0200 Subject: emacs: Add setup for IRC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bring back the setup I had in the Doom Emacs days. Indeed I'm not using IRC that much, but the configuration is pretty reliable for whenever I need it. Signed-off-by: Miquel Sabaté Solà --- .config/emacs/init.el | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to '.config/emacs/init.el') diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 0f39e04..e36829b 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -742,3 +742,37 @@ ;; Nice highlighting for patches inside of emails. (use-package message-view-patch :hook (gnus-part-display . message-view-patch-highlight)) + +;;; +;; IRC + +(require 'auth-source) +(setq auth-sources '("~/org/authinfo.gpg")) + +(use-package circe + :ensure t + :bind (("C-c i" . mssola/connect-libera-chat)) + :config + + ;; Helper function to securely fetch password via auth-source. + (defun mssola/irc-fetch-password (host port username) + (let ((data (auth-source-search :host host :port port :user username))) + (when data + (let ((secret (plist-get (car data) :secret))) + (if (functionp secret) (funcall secret) secret))))) + + (defun mssola/connect-libera-chat () + "Connect to the pre-configured Libera Chat network using Circe." + (interactive) + (circe "Libera Chat")) + + (setq circe-network-options + '(("Libera Chat" + :host "irc.libera.chat" + :port 6697 + :tls t + :nick "mssola" + :sasl-username "mssola" + :sasl-password (lambda (&rest _) + (mssola/irc-fetch-password "irc.libera.chat" 6697 "mssola")) + :channels ("#riscv" "#btrfs"))))) -- cgit v1.2.3