diff --git a/hosts/worf/configuration.nix b/hosts/worf/configuration.nix index 6b7af8d..6dc2bc0 100644 --- a/hosts/worf/configuration.nix +++ b/hosts/worf/configuration.nix @@ -59,6 +59,8 @@ ripgrep sshfs wget + + nix-output-monitor ]; variables = { diff --git a/hosts/worf/home.nix b/hosts/worf/home.nix index 7816227..dcfc8ce 100644 --- a/hosts/worf/home.nix +++ b/hosts/worf/home.nix @@ -7,6 +7,7 @@ imports = [ ./../../home/base.nix ./../../home/alacritty.nix + ./programs/newsboat ]; home.packages = with pkgs; [ diff --git a/hosts/worf/programs/newsboat/default.nix b/hosts/worf/programs/newsboat/default.nix new file mode 100644 index 0000000..7fe1b1f --- /dev/null +++ b/hosts/worf/programs/newsboat/default.nix @@ -0,0 +1,64 @@ +{ lib, config, ... }: +let + defaultBrowser = "open %u"; + videoViewer = "open %u"; +in { + imports = [ ./sources.nix ]; + + programs.newsboat = { + enable = true; + autoReload = true; + maxItems = 50; + browser = ''"${defaultBrowser}"''; + extraConfig = lib.strings.concatStringsSep "\n" [ + '' + macro m set browser "${videoViewer}"; open-in-browser ; set browser "${defaultBrowser}" + macro l set browser "${defaultBrowser}"; open-in-browser ; set browser "${defaultBrowser}" + '' + + # Unbind keys + '' + unbind-key ENTER + unbind-key j + unbind-key k + unbind-key J + unbind-key K + '' + + # Bind keys - vim style + '' + bind-key j down + bind-key k up + bind-key l open + bind-key h quit + '' + + # Theme + # '' + # color background default default + # color listnormal default default + # color listnormal_unread default default + # color listfocus black cyan + # color listfocus_unread black cyan + # color info default black + # color article default default + # '' + + # Highlights + '' + highlight all "---.*---" yellow + highlight feedlist ".*(0/0))" black + 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 + '' + ]; + }; +} diff --git a/hosts/worf/programs/newsboat/sources.nix b/hosts/worf/programs/newsboat/sources.nix new file mode 100644 index 0000000..3c33d63 --- /dev/null +++ b/hosts/worf/programs/newsboat/sources.nix @@ -0,0 +1,30 @@ +{ ... }: +let + mkSource = tags: url: { inherit tags url; }; +in { + programs.newsboat.urls = [ + (mkSource [ "news" "norway" ] "https://www.nrk.no/toppsaker.rss") + (mkSource [ "news" "norway" ] "https://www.bygdeposten.no/service/rss") + (mkSource [ "news" "norway" ] "https://www.nidaros.no/service/rss") + (mkSource [ "news" "tech" ] "https://rss.kode24.no/") + + (mkSource [ "ntnu" ] "https://omegav.no/newsrss") + (mkSource [ "ntnu" ] "https://www.pvv.ntnu.no/w/api.php?hidebots=1&urlversion=1&days=7&limit=50&action=feedrecentchanges&feedformat=atom") + (mkSource [ "ntnu" ] "https://varsel.it.ntnu.no/subscribe/rss/") + + (mkSource [ "tech" "linux" ] "https://archlinux.org/feeds/news/") + (mkSource [ "tech" "linux" "nixos" ] "https://nixos.org//blog/announcements-rss.xml") + (mkSource [ "tech" ] "https://hnrss.org/frontpage") + (mkSource [ "tech" ] "https://lwn.net/headlines/rss") + + (mkSource [ "tech" "blog" ] "https://xeiaso.net/blog.rss") + + (mkSource [ "alerts" ] "https://domene.shop/rss/no/news.rdf") + (mkSource [ "alerts" ] "https://domene.shop/rss/no/status.rdf") + + (mkSource [ "videos" ] "https://rss.nebula.app/video/channels/thelogisticsofx.rss") + (mkSource [ "videos" ] "https://rss.nebula.app/video/channels/wendover.rss") + (mkSource [ "videos" ] "https://rss.nebula.app/video/channels/realengineering.rss") + ]; +} +