nom: add module

adds a module for nom, a terminal-based rss feed reader.
This commit is contained in:
oneorseveralcats
2026-03-20 01:12:18 -04:00
committed by Austin Horstman
parent 2c629ba7ed
commit 932ca46013
5 changed files with 94 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
{
time = "2026-03-20T04:51:15+00:00";
condition = true;
message = ''
A new module is available: 'programs.nom'.
Nom is a terminal-based, rss feed reader that looks like
the markdown reader glow and supports defining different
openers for different url regex patterns.
'';
}

58
modules/programs/nom.nix Normal file
View File

@@ -0,0 +1,58 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.nom;
in
{
meta.maintainers = [ lib.hm.maintainers.oneorseveralcats ];
options.programs.nom = {
enable = lib.mkEnableOption "nom a terminal, rss feed reader.";
package = lib.mkPackageOption pkgs "nom" { nullable = true; };
settings = lib.mkOption {
type = lib.types.attrsOf lib.types.anything;
default = { };
example = {
autoread = true;
showread = false;
ordering = "desc";
openers = [
{
regex = "youtube";
cmd = "mpv %s";
}
];
theme = {
glamour = "dark";
};
feeds = [
{
name = "Jeff Geerling";
url = "https://www.youtube.com/feeds/videos.xml?channel_id=UCR-DXc1voovS8nhAvccRZhg";
}
];
};
description = ''
Settings for nom including themes, rss feeds, and openers for specific url regexes.
Options are listed on the github: <https://github.com/guyfedwards/nom>.
'';
};
};
config = lib.mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [
cfg.package
];
xdg.configFile."nom/config.yml" = lib.mkIf (cfg.settings != { }) {
source = pkgs.writeText "config.yml" (lib.generators.toYAML { } cfg.settings);
};
};
}

View File

@@ -0,0 +1,13 @@
{ ... }:
{
programs.nom = {
enable = true;
settings = {
autoread = true;
};
};
nmt.script = ''
assertFileExists "home-files/.config/nom/config.yml"
'';
}

View File

@@ -0,0 +1,4 @@
{
nom-config-exists = ./config-exists.nix;
nom-disabled = ./disabled.nix;
}

View File

@@ -0,0 +1,8 @@
{ ... }:
{
programs.nom.enable = false;
nmt.script = ''
assertPathNotExists "home-files/.config/nom"
'';
}