env: RSS populate a .opml file which can be manually imported into NewsFlash
This commit is contained in:
parent
aa6153aa56
commit
8afe0c0be5
1
modules/universal/env/feeds.nix
vendored
1
modules/universal/env/feeds.nix
vendored
|
@ -3,6 +3,7 @@
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
|
# TODO: fold this into RSS, with an `audio` category
|
||||||
sane.feeds.podcastUrls = mkOption {
|
sane.feeds.podcastUrls = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [
|
default = [
|
||||||
|
|
35
modules/universal/env/home-manager.nix
vendored
35
modules/universal/env/home-manager.nix
vendored
|
@ -214,6 +214,7 @@ in
|
||||||
[qt]
|
[qt]
|
||||||
qt-privacy-ask=0
|
qt-privacy-ask=0
|
||||||
'';
|
'';
|
||||||
|
|
||||||
xdg.configFile."gpodderFeeds.opml".text =
|
xdg.configFile."gpodderFeeds.opml".text =
|
||||||
let
|
let
|
||||||
entries = builtins.toString (builtins.map
|
entries = builtins.toString (builtins.map
|
||||||
|
@ -228,6 +229,40 @@ in
|
||||||
</opml>
|
</opml>
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# news-flash RSS viewer
|
||||||
|
xdg.configFile."newsflashFeeds.opml".text =
|
||||||
|
let
|
||||||
|
entries = sysconfig.sane.feeds.rss;
|
||||||
|
urlsForCat = cat: builtins.filter (rss: builtins.elem cat entries."${rss}".tags) (builtins.attrNames entries);
|
||||||
|
outlineEntriesFor = cat: builtins.map (rss: ''
|
||||||
|
<outline type="rss" xmlUrl="${rss}" />
|
||||||
|
'') (urlsForCat cat);
|
||||||
|
outlineFor = cat: let
|
||||||
|
outlines = outlineEntriesFor cat;
|
||||||
|
in ''
|
||||||
|
<outline text="${cat}" title="${cat}">
|
||||||
|
${builtins.toString outlines}
|
||||||
|
</outline>
|
||||||
|
'';
|
||||||
|
outlines = [
|
||||||
|
(outlineFor "uncat")
|
||||||
|
(outlineFor "rat")
|
||||||
|
(outlineFor "tech")
|
||||||
|
(outlineFor "pol")
|
||||||
|
(outlineFor "visual")
|
||||||
|
];
|
||||||
|
in ''
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<opml version="2.0">
|
||||||
|
<head>
|
||||||
|
<title>NewsFlash OPML export</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
${builtins.toString outlines}
|
||||||
|
</body>
|
||||||
|
</opml>
|
||||||
|
'';
|
||||||
|
|
||||||
|
|
||||||
# gnome feeds RSS viewer
|
# gnome feeds RSS viewer
|
||||||
xdg.configFile."org.gabmus.gfeeds.json".text = builtins.toJSON {
|
xdg.configFile."org.gabmus.gfeeds.json".text = builtins.toJSON {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user