worf: add newsboat. add nom.

This commit is contained in:
Felix Albrigtsen 2024-01-20 12:53:58 +01:00
parent 0920617a72
commit e761335c60
4 changed files with 97 additions and 0 deletions

View File

@ -59,6 +59,8 @@
ripgrep ripgrep
sshfs sshfs
wget wget
nix-output-monitor
]; ];
variables = { variables = {

View File

@ -7,6 +7,7 @@
imports = [ imports = [
./../../home/base.nix ./../../home/base.nix
./../../home/alacritty.nix ./../../home/alacritty.nix
./programs/newsboat
]; ];
home.packages = with pkgs; [ home.packages = with pkgs; [

View File

@ -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
''
];
};
}

View File

@ -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")
];
}