diff --git a/home/programs/cheat.nix b/home/programs/cheat.nix new file mode 100644 index 0000000..ba1f35d --- /dev/null +++ b/home/programs/cheat.nix @@ -0,0 +1,36 @@ +{ pkgs, config, ... }: +let + toYaml = (pkgs.formats.yaml { }).generate; +in +{ + home.packages = with pkgs; [ + cheat + ]; + + xdg.configFile."cheat/conf.yml".source = toYaml "conf.yml" { + colorize = true; + # TODO set based on global color scheme + style = "rose-pine"; + 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; + } + ]; + }; +} diff --git a/home/programs/default.nix b/home/programs/default.nix index b97a1c1..ad21ee8 100644 --- a/home/programs/default.nix +++ b/home/programs/default.nix @@ -5,6 +5,7 @@ ./bat.nix ./btop.nix ./cava.nix + ./cheat.nix ./curl.nix ./eza.nix ./figlet.nix