rss2email + msmtp (#95)

This commit is contained in:
Sridhar Ratnakumar 2025-08-27 10:11:03 -04:00 committed by GitHub
parent 06c22a2087
commit 27eab309ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 81 additions and 0 deletions

View file

@ -12,6 +12,8 @@ in
self.nixosModules.default
./configuration.nix
./home-media.nix
./msmtp.nix
./rss2email
(self + /modules/nixos/linux/lxd.nix)
(self + /modules/nixos/linux/eternal-terminal.nix)
# (self + /modules/nixos/linux/vira.nix)

View file

@ -0,0 +1,28 @@
{ flake, config, ... }:
{
age.secrets."gmail-app-password" = {
file = flake.inputs.self + /secrets/gmail-app-password.age;
# HACK: why couple to caller of sendmail? smh.
owner = "rss2email";
group = "rss2email";
};
programs.msmtp = {
enable = true;
setSendmail = true;
defaults = {
auth = true;
tls = true;
tls_trust_file = "/etc/ssl/certs/ca-certificates.crt";
};
accounts.default = {
host = "smtp.gmail.com";
port = 587;
from = "pervasiveproximity@gmail.com";
user = "pervasiveproximity@gmail.com";
passwordeval = "cat ${config.age.secrets."gmail-app-password".path}";
};
};
}

View file

@ -0,0 +1,20 @@
{ ... }:
{
services.rss2email = {
enable = true;
to = "srid@srid.ca";
interval = "1d"; # Check every day
config = {
digest = true;
digest-type = "multipart/mixed"; # Put content in email body instead of .eml attachments
html-mail = true; # Send HTML emails for better formatting
subject-format = "Daily digest: {feed-title}"; # Better subject line
use-css = true;
css = "body { font-family: Arial, sans-serif; line-height: 1.6; } h2 { color: #333; border-bottom: 2px solid #eee; padding-bottom: 5px; } a { color: #007acc; text-decoration: none; }";
force-from = true; # Only use the configured 'from' address
name-format = ""; # Don't add feed/author names to From field
};
feeds = import ./feeds.nix;
};
}

View file

@ -0,0 +1,19 @@
let
redditTop = subreddit: limit: period:
"https://www.reddit.com/r/${subreddit}/top/.rss?t=${period}&limit=${toString limit}";
in
{
# actualism
vineeto-discourse.url = "https://discuss.actualism.online/u/vineeto/activity.rss";
# general tech news
hackernews-best.url = "https://hnrss.org/best?points=50";
notebookcheck.url = "https://www.notebookcheck.net/RSS-Feed-Notebook-Reviews.8156.0.html";
# reddit
haskell-reddit-top.url = redditTop "haskell" 5 "day";
nixos-reddit-top.url = redditTop "nixos" 5 "day";
# woke drama
nixos-drupol-discourse-ukraine.url = "https://discourse.nixos.org/t/proposal-update-the-nixos-logo-for-ukrainian-flag-day-23-august/68375.rss";
}

11
secrets/gmail-app-password.age generated Normal file
View file

@ -0,0 +1,11 @@
age-encryption.org/v1
-> ssh-ed25519 96IXNQ AlPQKdJW4i7KiKFShOJiZS3jaU4rGHxfpTcbxFFhX0c
/T+E7XkiUOgWtdRVRz9T3ut/AKXLEZpIywdjgPSXetU
-> ssh-ed25519 Ysxvmg ib7r93LrHHqg8Mpy2qjHDscc1j78xHYn+mSE0mgCVmI
FIcdml33o0867qmVXsfwCTouhNFdzUMcpI/RkD1Ydvk
-> ssh-ed25519 HQ+y9w eqKQ865HffWRjvbj/I5Qoe/jxKEP0Fdjh3FxWppW3zc
4qtKAl3FFwfevlF0qFPe5brMRdll1cNDbOv/ynzrw94
-> ssh-ed25519 p0qplg QWiCH31vijXLdRi1ERrrsO9/wPnB5dVKmV+JQ7TxWig
bziVlyMK13NYneR0mmyipoKwTboEd8kQeOE2JS9evMw
--- vO0xh4UbUG45Wnq+c5oL6C4P42B87tYeZ2iKwBEKLa0
{òkU¤i¨{~¨eÙɤÓA#•N7uBÏ; äJ´¥]H¸Ät6}xÂ=i®ža

View file

@ -12,4 +12,5 @@ in
"github-nix-ci/srid.token.age".publicKeys = users ++ systems;
"github-nix-ci/emaletter.token.age".publicKeys = users ++ systems;
"pureintent-basic-auth.age".publicKeys = users ++ systems;
"gmail-app-password.age".publicKeys = users ++ systems;
}