mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
nom: add module
adds a module for nom, a terminal-based rss feed reader.
This commit is contained in:
committed by
Austin Horstman
parent
2c629ba7ed
commit
932ca46013
11
modules/misc/news/2026/03/2026-03-20_00-51-15.nix
Normal file
11
modules/misc/news/2026/03/2026-03-20_00-51-15.nix
Normal 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
58
modules/programs/nom.nix
Normal 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);
|
||||
};
|
||||
};
|
||||
}
|
||||
13
tests/modules/programs/nom/config-exists.nix
Normal file
13
tests/modules/programs/nom/config-exists.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.nom = {
|
||||
enable = true;
|
||||
settings = {
|
||||
autoread = true;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists "home-files/.config/nom/config.yml"
|
||||
'';
|
||||
}
|
||||
4
tests/modules/programs/nom/default.nix
Normal file
4
tests/modules/programs/nom/default.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
nom-config-exists = ./config-exists.nix;
|
||||
nom-disabled = ./disabled.nix;
|
||||
}
|
||||
8
tests/modules/programs/nom/disabled.nix
Normal file
8
tests/modules/programs/nom/disabled.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.nom.enable = false;
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists "home-files/.config/nom"
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user