start on rss feeds in mu4e

This commit is contained in:
willemml 2023-03-13 09:42:57 -07:00
parent 3cc349bcbf
commit 9ca9189554
Signed by: willemml
GPG key ID: C3DE5DF6198DACBD
2 changed files with 46 additions and 0 deletions

View file

@ -39,6 +39,7 @@ rec {
VISUAL = emacsCommand;
ORGDIR = "${config.home.homeDirectory}/Documents/org";
UBCDIR = "${ORGDIR}/ubc";
MAILDIR = "${config.home.homeDirectory}/Maildir";
};
stateVersion = "22.11";
username = "willem";
@ -47,6 +48,7 @@ rec {
imports = [
./accounts.nix
./darwin.nix
./feeds.nix
./packages.nix
./programs.nix
];

44
home/feeds.nix Normal file
View file

@ -0,0 +1,44 @@
{ config, pkgs, lib, ... }:
let
feeds = {
xkcd = "http://xkcd.com/atom.xml";
dailywtf = "http://syndication.thedailywtf.com/TheDailyWtf";
nixos = "https://weekly.nixos.org/feeds/all.rss.xml";
rust = "https://blog.rust-lang.org/feed.xml";
insiderust = "https://blog.rust-lang.org/inside-rust/feed.xml";
kdb424 = "https://blog.kdb424.xyz/atom.xml";
devto = "https://dev.to/feed/";
};
config = {
html-mail = "True";
date-header = "True";
from = "rss2email@home.localhost";
force-from = "False";
use-publisher-email = "True";
active = "true";
to = "willem@home.localhost";
email-protocol = "maildir";
maildir-mailbox = "feeds";
maildir-path = config.home.sessionVariables.MAILDIR;
};
mkFeedString = name: url: ''
[feed.${name}]
url = ${url}
'';
configStrings = lib.mapAttrsToList (name: value: "${name} = ${value}\n") config;
feedStrings = lib.mapAttrsToList mkFeedString feeds;
configArray = [ "[DEFAULT]\n" ] ++ configStrings ++ feedStrings;
configString = lib.concatStrings configArray;
in
{
home.packages = [ pkgs.rss2email ];
home.file.".config/rss2email.cfg".text = configString;
}