2024-11-16 12:57:30 -08:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (lib) mkIf;
|
2024-11-16 22:34:40 -08:00
|
|
|
inherit (lib.marleyos) mkEnableModule;
|
2024-11-16 12:57:30 -08:00
|
|
|
|
2024-11-16 22:34:40 -08:00
|
|
|
cfg = config.marleyos.programs.cheat;
|
|
|
|
inherit (config.marleyos.theme) colors;
|
2024-11-16 12:57:30 -08:00
|
|
|
|
|
|
|
toYAML = (pkgs.formats.yaml { }).generate;
|
|
|
|
in
|
|
|
|
{
|
2024-11-16 23:05:17 -08:00
|
|
|
options.marleyos = mkEnableModule "programs.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;
|
2024-11-16 22:34:40 -08:00
|
|
|
style = "${colors.base}";
|
2024-11-16 12:57:30 -08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|