Improve feed management
This commit is contained in:
parent
0871855325
commit
c83eeae7d6
|
@ -75,6 +75,7 @@ in [
|
|||
Browser = fork "firefox";
|
||||
"Private Browser" = fork "firefox --private-window";
|
||||
Chromium = fork "chromium";
|
||||
"Software-Updates" = "software-updates";
|
||||
Watchfeeds = "watchfeeds";
|
||||
News = "news";
|
||||
Deluge = fork "deluge";
|
||||
|
|
|
@ -19,38 +19,61 @@
|
|||
</rss>
|
||||
EOF
|
||||
'';
|
||||
watchfeedsConfig = ''
|
||||
datetime-format "%Y-%m-%d"
|
||||
cleanup-on-quit no
|
||||
'';
|
||||
watchfeeds = [
|
||||
# Haskell
|
||||
"https://www.youtube.com/feeds/videos.xml?channel_id=UCI1Z201n-8OelkSg0DVOsng" # Tweag
|
||||
"https://www.youtube.com/feeds/videos.xml?channel_id=UCxVE_2I_fsOe3Mgn_QlXqbQ" # Nomeata
|
||||
|
||||
"http://www.zdf.de/rss/podcast/video/zdf/comedy/die-anstalt"
|
||||
|
||||
"https://www.zdf.de/rss/zdf/show/mai-think-x-die-show"
|
||||
"https://www.youtube.com/feeds/videos.xml?channel_id=UCyHDQ5C6z1NDmJ4g6SerW8g" # Mailab
|
||||
|
||||
"https://www.youtube.com/feeds/videos.xml?channel_id=UC2C_jShtL725hvbm1arSV9w" # GCP Grey
|
||||
|
||||
"https://www.youtube.com/feeds/videos.xml?channel_id=UCpXBGqwsBkpvcYjsJBQ7LEQ" # Critical Role
|
||||
"exec:${serien}"
|
||||
];
|
||||
newsConfig = ''
|
||||
${watchfeedsConfig}
|
||||
urls-source "ocnews"
|
||||
ocnews-url "https://cloud.maralorn.de"
|
||||
ocnews-login "maralorn"
|
||||
ocnews-password "${(pkgs.privateValue {adminpass = "";} "nextcloud-admin").adminpass}"
|
||||
'';
|
||||
in {
|
||||
xdg.configFile."newsboat/urls".text = lib.concatStringsSep "\n" watchfeeds;
|
||||
home = {
|
||||
packages = builtins.attrValues {
|
||||
news = pkgs.writeShellScriptBin "news" "${pkgs.newsboat}/bin/newsboat -r -C ${builtins.toFile "news-config" newsConfig}";
|
||||
watchfeeds = pkgs.writeShellScriptBin "watchfeeds" "${pkgs.newsboat}/bin/newsboat -r -C ${builtins.toFile "watchfeeds-config" watchfeedsConfig}";
|
||||
packages = lib.mapAttrsToList (name: {
|
||||
config ? "",
|
||||
feeds ? [],
|
||||
}: let
|
||||
configFile = builtins.toFile "${name}-config" ''
|
||||
show-read-feeds no
|
||||
show-read-articles no
|
||||
datetime-format "%Y-%m-%d"
|
||||
cleanup-on-quit no
|
||||
${config}
|
||||
'';
|
||||
urlFile = pkgs.writeText "${name}-urls" (lib.concatStringsSep "\n" feeds);
|
||||
in
|
||||
pkgs.writeShellScriptBin name "${pkgs.newsboat}/bin/newsboat -r -C ${configFile} -u ${urlFile} \"$@\"") {
|
||||
watchfeeds = {
|
||||
config = ''browser "mpv %u"'';
|
||||
feeds = [
|
||||
# Haskell
|
||||
"https://www.youtube.com/feeds/videos.xml?channel_id=UCI1Z201n-8OelkSg0DVOsng" # Tweag
|
||||
"https://www.youtube.com/feeds/videos.xml?channel_id=UCxVE_2I_fsOe3Mgn_QlXqbQ" # Nomeata
|
||||
|
||||
"http://www.zdf.de/rss/podcast/video/zdf/comedy/die-anstalt"
|
||||
|
||||
"https://www.zdf.de/rss/zdf/show/mai-think-x-die-show"
|
||||
"https://www.youtube.com/feeds/videos.xml?channel_id=UCyHDQ5C6z1NDmJ4g6SerW8g" # Mailab
|
||||
|
||||
"https://www.youtube.com/feeds/videos.xml?channel_id=UC2C_jShtL725hvbm1arSV9w" # GCP Grey
|
||||
|
||||
"https://www.youtube.com/feeds/videos.xml?channel_id=UCpXBGqwsBkpvcYjsJBQ7LEQ" # Critical Role
|
||||
"exec:${serien}"
|
||||
];
|
||||
};
|
||||
news = {
|
||||
config = ''
|
||||
urls-source "ocnews"
|
||||
ocnews-url "https://cloud.maralorn.de"
|
||||
ocnews-login "maralorn"
|
||||
ocnews-password "${(pkgs.privateValue {adminpass = "";} "nextcloud-admin").adminpass}"
|
||||
'';
|
||||
};
|
||||
software-updates = {
|
||||
feeds =
|
||||
[
|
||||
"http://packdeps.haskellers.com/feed/maralorn"
|
||||
"https://repology.org/maintainer/malte.brandy%40maralorn.de/feed-for-repo/nix_unstable/atom"
|
||||
]
|
||||
# GitHub releases of things I need to manually update
|
||||
++ map (name: "https://github.com/${name}/releases.atom") [
|
||||
"5etools-mirror-1/5etools-mirror-1.github.io"
|
||||
"devture/email2matrix"
|
||||
"unisonweb/unison"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue