#:use-module (gnu home services)
#:use-module (gnu home services shepherd)
#:use-module (gnu packages aspell)
+ #:use-module (gnu packages curl)
#:use-module (gnu packages emacs)
#:use-module (gnu packages emacs-xyz)
#:use-module (gnu packages freedesktop)
(list "bash/.config/profile.d/50-gpg.sh"
"bash/.config/profile.d/50-pass.sh"
"emacs/.config/emacs/conf/conf-crypt.el")))))
+
+(define emacs-rss-service
+ (service home-program-service-type
+ (home-program-configuration
+ (packages
+ (list curl emacs-elfeed))
+ (dotfiles
+ (list "emacs/.config/emacs/conf/conf-rss.el")))))
+
(define emacs-service
(service home-program-service-type
(home-program-configuration
emacs-org-service
emacs-package-service
emacs-pass-service
+ emacs-rss-service
emacs-service))
--- /dev/null
+;; Copyright (c) 2022 Jakub Czajka <jakub@ekhem.eu.org>
+;; License: GPL-3.0 or later.
+;;
+;; conf-rss.el - configuration for the RSS reader.
+
+(require 'conf-package)
+(require 'conf-variables)
+
+(defcustom conf:elfeed-db-directory
+ (expand-file-name "~/Elfeed")
+ "Directory with the `elfeed' database."
+ :type 'directory
+ :group 'conf:configuration)
+
+(defcustom conf:elfeed-opml-file
+ (expand-file-name "~/rss_feed.opml")
+ "OPML file with RSS feeds to follow."
+ :type 'file
+ :group 'conf:configuration)
+
+(use-package elfeed
+ :requires
+ (conf-keys)
+ :when
+ (conf:executables-p (list "curl"))
+ :ensure t
+ :bind
+ ("C-c f" . elfeed)
+ (:map elfeed-search-mode-map
+ ("?" . conf:elfeed-transient)
+ ([remap elfeed-search-fetch] . conf:elfeed-load-opml-and-fetch))
+ :custom
+ (elfeed-db-directory conf:elfeed-db-directory)
+ (elfeed-search-filter "@1-week-ago +unread ![$]")
+ :config
+ (transient-define-prefix conf:elfeed-transient ()
+ "Transient keymap with usefeul commands for `elfeed'."
+ [["Update"
+ ("g" "refresh" elfeed-search-update--force)
+ ("G" "fetch" elfeed-search-fetch)]
+ ["Search"
+ ("RET" "show" elfeed-search-show-entry)
+ ("c" "clear" elfeed-search-clear-filter)
+ ("b" "url" elfeed-search-browse-url)
+ ("s" "search" elfeed-search-live-filter)
+ ("S" "filter" elfeed-search-set-filter)]
+ ["Navigation"
+ ("<" "first entry" elfeed-search-first-entry)
+ (">" "last entry" elfeed-search-last-entry)]
+ ["Tags"
+ ("r" "read" elfeed-search-untag-all-unread)
+ ("u" "unread" elfeed-search-tag-all-unread)
+ ("+" "tag all" elfeed-search-tag-all)
+ ("-" "untag all" elfeed-search-untag-all)]
+ ["Others"
+ ("h" "help" describe-mode)
+ ("q" "quit" elfeed-search-quit-window)]])
+
+ (defun conf:elfeed-load-opml-and-fetch ()
+ "Insert `conf:elfeed-opml-file' file to `elfeed-feeds' and update feed."
+ (interactive)
+ (when (file-exists-p conf:elfeed-opml-file)
+ (elfeed-load-opml conf:elfeed-opml-file))
+ (call-interactively #'elfeed-search-fetch)))
+
+(provide 'conf-rss)