Compare commits

...

1 commit

Author SHA1 Message Date
f1549ce21f
feat(home): Cheat 2024-11-16 12:57:30 -08:00
2 changed files with 52 additions and 0 deletions

View file

@ -18,6 +18,7 @@ in
bat = enabled;
btop = enabled;
cava = enabled;
cheat = enabled;
fish = enabled;
journalctl = enabled;
neo = enabled;

View file

@ -0,0 +1,51 @@
{
lib,
config,
namespace,
pkgs,
...
}:
let
inherit (lib) mkIf;
inherit (lib.${namespace}) mkEnableModule;
cfg = config.${namespace}.programs.cheat;
inherit (config.${namespace}) theme;
toYAML = (pkgs.formats.yaml { }).generate;
in
{
options = mkEnableModule "programs.cheat";
config = mkIf cfg.enable {
home.packages = with pkgs; [
cheat
];
xdg.configFile."cheat/conf.yml".source = toYAML "conf.yml" {
colorize = true;
style = "${theme.colors.base}";
formatter = "terminal256";
pager = "less -FRX";
cheatpaths =
let
cheatDir = "${config.xdg.configHome}/cheat/cheatsheets";
in
[
{
name = "community";
path = "${cheatDir}/community";
tags = [ "community" ];
readonly = true;
}
{
name = "personal";
path = "${cheatDir}/personal";
tags = [ "personal" ];
readonly = false;
}
];
};
};
}