marleyos/modules/home/programs/cheat/default.nix
punkfairie 15372b7726
feat: ${namespace} -> marleyos
There was little point to doing this anyway as project-wide find &
replace is trivial.
2024-11-16 22:36:34 -08:00

50 lines
1,018 B
Nix

{
lib,
config,
pkgs,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
cfg = config.marleyos.programs.cheat;
inherit (config.marleyos.theme) colors;
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 = "${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;
}
];
};
};
}