tuiApps: add sfeed
This commit is contained in:
parent
048dbc5809
commit
fb7cb091e3
|
@ -85,6 +85,7 @@ let
|
||||||
inherit (pkgs)
|
inherit (pkgs)
|
||||||
aerc # email client
|
aerc # email client
|
||||||
offlineimap # email mailox sync
|
offlineimap # email mailox sync
|
||||||
|
sfeed # RSS fetcher
|
||||||
visidata # TUI spreadsheet viewer/editor
|
visidata # TUI spreadsheet viewer/editor
|
||||||
w3m
|
w3m
|
||||||
;
|
;
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
./newsflash.nix
|
./newsflash.nix
|
||||||
./offlineimap.nix
|
./offlineimap.nix
|
||||||
./ripgrep.nix
|
./ripgrep.nix
|
||||||
|
./sfeed.nix
|
||||||
./splatmoji.nix
|
./splatmoji.nix
|
||||||
./steam.nix
|
./steam.nix
|
||||||
./sublime-music.nix
|
./sublime-music.nix
|
||||||
|
|
28
hosts/common/programs/sfeed.nix
Normal file
28
hosts/common/programs/sfeed.nix
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# simple RSS and Atom parser
|
||||||
|
# - <https://codemadness.org/sfeed-simple-feed-parser.html>
|
||||||
|
# - used by sxmo
|
||||||
|
# - man 5 sfeedrc
|
||||||
|
#
|
||||||
|
# call `sfeed_update` to query each feed and populate entries in ~/.sfeed/feeds
|
||||||
|
{ lib, config, sane-lib, ... }:
|
||||||
|
let
|
||||||
|
feeds = sane-lib.feeds;
|
||||||
|
allFeeds = config.sane.feeds;
|
||||||
|
wantedFeeds = feeds.filterByFormat ["text"] allFeeds;
|
||||||
|
sfeedEntries = builtins.map (feed:
|
||||||
|
# format:
|
||||||
|
# feed <name> <feedurl> [basesiteurl] [encoding]
|
||||||
|
lib.escapeShellArgs [ "feed" (if feed.title != null then feed.title else feed.url) feed.url ]
|
||||||
|
) wantedFeeds;
|
||||||
|
in {
|
||||||
|
sane.programs.sfeed = {
|
||||||
|
fs.".sfeed/sfeedrc".symlink.text = ''
|
||||||
|
feeds() {
|
||||||
|
${lib.concatStringsSep "\n " sfeedEntries}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
|
# this is where the parsed feed items go
|
||||||
|
persist.plaintext = [ ".sfeed/feeds" ];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user