gpodder: auto-import feeds on launch

This commit is contained in:
colin 2022-09-23 04:14:46 -07:00
parent 2456317004
commit 34b013f82a
6 changed files with 77 additions and 27 deletions

View File

@ -2,6 +2,7 @@
{
imports = [
./feeds.nix
./home-manager.nix
./home-packages.nix
./system-packages.nix

35
modules/universal/env/feeds.nix vendored Normal file
View File

@ -0,0 +1,35 @@
{ lib, ... }:
with lib;
{
options = {
sane.feeds.podcastUrls = mkOption {
type = types.listOf types.str;
default = [
"https://lexfridman.com/feed/podcast/"
## Astral Codex Ten
"http://feeds.libsyn.com/108018/rss"
## Econ Talk
"https://feeds.simplecast.com/wgl4xEgL"
## Cory Doctorow
"https://feeds.feedburner.com/doctorow_podcast"
"https://congressionaldish.libsyn.com/rss"
## Civboot
"https://anchor.fm/s/34c7232c/podcast/rss"
"https://feeds.feedburner.com/80000HoursPodcast"
"https://allinchamathjason.libsyn.com/rss"
## Eric Weinstein
"https://rss.art19.com/the-portal"
"https://feeds.megaphone.fm/darknetdiaries"
"http://feeds.wnyc.org/radiolab"
"https://wakingup.libsyn.com/rss"
## 99% Invisible
"https://feeds.simplecast.com/BqbsxVfO"
"https://rss.acast.com/ft-tech-tonic"
"https://feeds.feedburner.com/dancarlin/history?format=xml"
## 60 minutes (NB: this features more than *just* audio?)
"https://www.cbsnews.com/latest/rss/60-minutes"
];
};
};
}

View File

@ -154,39 +154,28 @@ in
xdg.configFile."vlc/vlcrc".text =
let
podcast_urls = lib.strings.concatStringsSep "|" [
"https://lexfridman.com/feed/podcast/"
## Astral Codex Ten
"http://feeds.libsyn.com/108018/rss"
## Econ Talk
"https://feeds.simplecast.com/wgl4xEgL"
## Cory Doctorow
"https://feeds.feedburner.com/doctorow_podcast"
"https://congressionaldish.libsyn.com/rss"
## Civboot
"https://anchor.fm/s/34c7232c/podcast/rss"
"https://feeds.feedburner.com/80000HoursPodcast"
"https://allinchamathjason.libsyn.com/rss"
## Eric Weinstein
"https://rss.art19.com/the-portal"
"https://feeds.megaphone.fm/darknetdiaries"
"http://feeds.wnyc.org/radiolab"
"https://wakingup.libsyn.com/rss"
## 99% Invisible
"https://feeds.simplecast.com/BqbsxVfO"
"https://rss.acast.com/ft-tech-tonic"
"https://feeds.feedburner.com/dancarlin/history?format=xml"
## 60 minutes (NB: this features more than *just* audio?)
"https://www.cbsnews.com/latest/rss/60-minutes"
];
podcastUrls = lib.strings.concatStringsSep "|" sysconfig.sane.feeds.podcastUrls;
in ''
[podcast]
podcast-urls=${podcast_urls}
podcast-urls=${podcastUrls}
[core]
metadata-network-access=0
[qt]
qt-privacy-ask=0
'';
xdg.configFile."gpodderFeeds.opml".text =
let
entries = builtins.toString (builtins.map
(url: ''\n <outline xmlUrl="${url}" type="rss"/>'')
sysconfig.sane.feeds.podcastUrls
);
in ''
<?xml version="1.0" encoding="utf-8"?>
<opml version="2.0">
<body>${entries}
</body>
</opml>
'';
# gnome feeds RSS viewer
xdg.configFile."org.gabmus.gfeeds.json".text = builtins.toJSON {

View File

@ -67,7 +67,7 @@ let
gnome-podcasts
gnome.gnome-system-monitor
gnome.gnome-terminal # works on phosh
gpodder
gpodder-configured
gthumb
inkscape
krita

View File

@ -0,0 +1,24 @@
{ pkgs
, writeShellScript
, config
}:
(pkgs.symlinkJoin {
name = "gpodder-configured";
paths = [ pkgs.gpodder ];
buildInputs = [ pkgs.makeWrapper ];
# gpodder keeps all its feeds in a sqlite3 database.
# we can configure the feeds externally by wrapping gpodder and just instructing it to import
# a feedlist every time we run it.
# repeat imports are deduplicated -- assuming network access (not sure how it behaves when disconnected).
postBuild = ''
makeWrapper $out/bin/gpodder $out/bin/gpodder-configured \
--run "$out/bin/gpo import ~/.config/gpodderFeeds.opml"
# fix up the .desktop file to invoke our wrapped application
orig_desktop=$(readlink $out/share/applications/gpodder.desktop)
unlink $out/share/applications/gpodder.desktop
sed "s:Exec=.*:Exec=$out/bin/gpodder-configured:" $orig_desktop > $out/share/applications/gpodder.desktop
'';
})

View File

@ -22,6 +22,7 @@
#### customized packages
fluffychat-moby = prev.callPackage ./fluffychat-moby { pkgs = prev; };
gpodder-configured = prev.callPackage ./gpodder-configured { pkgs = prev; };
# nixos-unstable pleroma is too far out-of-date for our db
pleroma = prev.callPackage ./pleroma { };
# jackett doesn't allow customization of the bind address: this will probably always be here.