From 92f360e2bb5409571eaff101a528c66f4cbee5ae Mon Sep 17 00:00:00 2001 From: punkfairie Date: Thu, 14 Nov 2024 20:53:32 -0800 Subject: [PATCH] feat(cheat): Install cheat --- home/programs/cheat.nix | 36 ++++++++++++++++++++++++++++++++++++ home/programs/default.nix | 1 + 2 files changed, 37 insertions(+) create mode 100644 home/programs/cheat.nix 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