Files
dotfiles/modules/tuifeed.nix
2024-03-17 02:45:41 +05:30

52 lines
1.1 KiB
Nix

{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.programs.tuifeed;
tomlFormat = pkgs.formats.toml { };
in
{
options = {
programs.tuifeed = {
enable = mkEnableOption "tuifeed - a terminal RSS/Atom reader";
config = with types; {
sources = mkOption {
type = attrsOf str;
default = { };
description = ''
Urls that will be fetched ~/.config/tuifeed/urls.yml
'';
example = { };
};
article_title = mkOption {
type = attrsOf bool;
default = {
"show-author" = true;
"show-timestamp" = true;
};
description = ''
Urls that will be fetched ~/.config/tuifeed/urls.yml
'';
example = { };
};
};
};
};
config = {
home.packages = mkIf cfg.enable [ pkgs.tuifeed ];
xdg.configFile = mkIf cfg.enable {
"tuifeed/config.toml".source = tomlFormat.generate "tuifeed-config" {
sources = cfg.config.sources;
"article-title" = cfg.config.article_title;
};
};
};
}