2024-11-16 12:57:30 -08:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
2025-01-12 15:29:50 -08:00
|
|
|
}: let
|
2024-11-16 23:29:38 -08:00
|
|
|
inherit (lib) mkEnableOption mkIf;
|
2024-11-16 12:57:30 -08:00
|
|
|
|
2024-11-16 22:34:40 -08:00
|
|
|
cfg = config.marleyos.programs.cheat;
|
2024-11-16 12:57:30 -08:00
|
|
|
|
2025-01-12 15:29:50 -08:00
|
|
|
toYAML = (pkgs.formats.yaml {}).generate;
|
|
|
|
in {
|
2024-11-16 23:53:46 -08:00
|
|
|
options.marleyos.programs.cheat.enable = mkEnableOption "cheat";
|
2024-11-16 12:57:30 -08:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
cheat
|
|
|
|
];
|
|
|
|
|
|
|
|
xdg.configFile."cheat/conf.yml".source = toYAML "conf.yml" {
|
|
|
|
colorize = true;
|
2025-01-12 15:29:50 -08:00
|
|
|
style = lib.mkIf config.rose-pine.enable "rose-pine";
|
2024-11-16 12:57:30 -08:00
|
|
|
formatter = "terminal256";
|
|
|
|
pager = "less -FRX";
|
|
|
|
|
2025-01-12 15:29:50 -08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
];
|
2024-11-16 12:57:30 -08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|