From faf0d2472021006870ed60cb932e4e03b154a54e Mon Sep 17 00:00:00 2001 From: sefidel Date: Tue, 13 Feb 2024 15:22:30 +0900 Subject: feat(home/multimedia): add newsboat --- home/profiles/multimedia/default.nix | 51 +++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) (limited to 'home/profiles') diff --git a/home/profiles/multimedia/default.nix b/home/profiles/multimedia/default.nix index bb4a8fd..5890fb7 100644 --- a/home/profiles/multimedia/default.nix +++ b/home/profiles/multimedia/default.nix @@ -1,5 +1,8 @@ { config, lib, pkgs, ... }: -let cfg = config.profiles.multimedia; +let + cfg = config.profiles.multimedia; + + fixSopsPrefix = x: y: builtins.replaceStrings [ "%r" ] [ "/run/user/${toString x}" ] y; in { imports = [ @@ -14,6 +17,52 @@ in config = lib.mkIf cfg.enable { home.packages = with pkgs; [ vlc playerctl cider spotify ]; + sops.secrets.freshrss-api-password = { }; + + programs.newsboat = { + enable = true; + autoReload = true; + + extraConfig = '' + urls-source "freshrss" + freshrss-url "https://rss.exotic.sh/api/greader.php" + freshrss-login "sefidel" + freshrss-passwordeval "cat ${fixSopsPrefix 1000 config.sops.secrets.freshrss-api-password.path}" + + # Vim-like movement + bind-key j down feedlist + bind-key k up feedlist + bind-key j next articlelist + bind-key k prev articlelist + bind-key J next-feed articlelist + bind-key K prev-feed articlelist + bind-key j down article + bind-key k up article + + # Colorscheme to work with softjelly + color listnormal white default + color listnormal_unread white default + color listfocus white default reverse bold + color listfocus_unread white default reverse bold + color info yellow black + color background white default + color article white default + + # Additional Highlight groups + highlight article "(^Feed:.*|^Title:.*|^Author:.*)" cyan default bold + highlight article "(^Link:.*|^Date:.*)" default default + highlight article "https?://[^ ]+" green default + + highlight article "^(Title):.*$" blue default + highlight article "\\[[0-9][0-9]*\\]" magenta default bold + highlight article "\\[image\\ [0-9]+\\]" green default bold + highlight article "\\[embedded flash: [0-9][0-9]*\\]" green default bold + highlight article ":.*\\(link\\)$" cyan default + highlight article ":.*\\(image\\)$" blue default + highlight article ":.*\\(embedded flash\\)$" magenta default + ''; + }; + nixpkgs.allowedUnfree = [ "spotify" ]; }; } -- cgit 1.4.1