marleyos/modules/home/programs/cheat/default.nix

43 lines
919 B
Nix
Raw Normal View History

2024-11-16 12:57:30 -08:00
{
lib,
config,
pkgs,
...
}: let
cfg = config.marleyos.programs.cheat;
2024-11-16 12:57:30 -08:00
toYAML = (pkgs.formats.yaml {}).generate;
in {
options.marleyos.programs.cheat.enable = lib.mkEnableOption "cheat";
2024-11-16 12:57:30 -08:00
config = lib.mkIf cfg.enable {
2024-11-16 12:57:30 -08:00
home.packages = with pkgs; [
cheat
];
xdg.configFile."cheat/conf.yml".source = toYAML "conf.yml" {
colorize = true;
style = lib.mkIf config.rose-pine.enable "rose-pine";
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;
}
];
2024-11-16 12:57:30 -08:00
};
};
}