[feat] Add some stuff

This commit is contained in:
uttarayan21
2024-03-17 02:45:41 +05:30
parent 6f1cb3da8f
commit e0dffb350d
7 changed files with 177 additions and 34 deletions

51
modules/tuifeed.nix Normal file
View File

@@ -0,0 +1,51 @@
{ 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;
};
};
};
}