2023-03-03 02:22:37 +00:00
|
|
|
{ stdenv
|
|
|
|
, gnome-feeds
|
2022-12-25 07:33:24 +00:00
|
|
|
, gpodder
|
2023-03-03 02:22:37 +00:00
|
|
|
, makeWrapper
|
|
|
|
, python3
|
2023-04-27 08:00:38 +00:00
|
|
|
, static-nix-shell
|
2022-12-25 07:33:24 +00:00
|
|
|
, symlinkJoin
|
2022-09-23 11:14:46 +00:00
|
|
|
}:
|
|
|
|
|
2023-01-14 05:25:16 +00:00
|
|
|
let
|
2023-04-27 08:00:38 +00:00
|
|
|
remove-extra = static-nix-shell.mkPython3Bin {
|
2023-03-03 02:22:37 +00:00
|
|
|
pname = "gpodder-remove-extra";
|
|
|
|
src = ./.;
|
2023-04-27 08:00:38 +00:00
|
|
|
pyPkgs = _ps: {
|
|
|
|
"gnome-feeds.listparser" = gnome-feeds.listparser;
|
|
|
|
};
|
|
|
|
pkgs = {
|
|
|
|
inherit gpodder;
|
|
|
|
};
|
2023-03-03 02:22:37 +00:00
|
|
|
};
|
2023-01-14 05:25:16 +00:00
|
|
|
in
|
2023-01-13 15:09:43 +00:00
|
|
|
# we use a symlinkJoin so that we can inherit the .desktop and icon files from the original gPodder
|
2022-12-25 07:33:24 +00:00
|
|
|
(symlinkJoin {
|
2022-09-23 11:14:46 +00:00
|
|
|
name = "gpodder-configured";
|
2023-01-14 05:25:16 +00:00
|
|
|
paths = [ gpodder remove-extra ];
|
2023-02-10 00:45:44 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2022-09-23 11:14:46 +00:00
|
|
|
|
|
|
|
# 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.
|
2023-01-13 15:09:43 +00:00
|
|
|
# repeat imports are deduplicated by url, even when offline.
|
2022-09-23 11:14:46 +00:00
|
|
|
postBuild = ''
|
|
|
|
makeWrapper $out/bin/gpodder $out/bin/gpodder-configured \
|
2023-01-14 05:29:38 +00:00
|
|
|
--run "$out/bin/gpodder-remove-extra ~/.config/gpodderFeeds.opml" \
|
2023-01-14 05:25:16 +00:00
|
|
|
--run "$out/bin/gpo import ~/.config/gpodderFeeds.opml" \
|
2022-09-23 11:14:46 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
'';
|
2023-03-03 02:22:37 +00:00
|
|
|
|
|
|
|
passthru = {
|
|
|
|
remove-extra = remove-extra;
|
|
|
|
};
|
2022-09-23 11:14:46 +00:00
|
|
|
})
|