diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2025-10-01 16:38:42 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2025-10-02 22:56:55 +0200 |
| commit | b8b0adb37c6e776c87f8f4384a3e3f41ec1af989 (patch) | |
| tree | 533615a8e6ecc4e473d60bad3985ae7b84ca4fc6 /.config/emacs/init.el | |
| parent | 61f91364f8b6402665484a0834e27f67d60f15fa (diff) | |
| download | dotfiles-b8b0adb37c6e776c87f8f4384a3e3f41ec1af989.tar.gz dotfiles-b8b0adb37c6e776c87f8f4384a3e3f41ec1af989.zip | |
emacs: Add setup for IRC
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à <mssola@mssola.com>
Diffstat (limited to '.config/emacs/init.el')
| -rw-r--r-- | .config/emacs/init.el | 34 |
1 files changed, 34 insertions, 0 deletions
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"))))) |
