feat(home): Cheat
This commit is contained in:
parent
2fe36645b8
commit
cfc908e1a0
3 changed files with 52 additions and 36 deletions
|
@ -18,6 +18,7 @@ in
|
|||
bat = enabled;
|
||||
btop = enabled;
|
||||
cava = enabled;
|
||||
cheat = enabled;
|
||||
fish = enabled;
|
||||
journalctl = enabled;
|
||||
neo = enabled;
|
||||
|
|
51
modules/home/programs/cheat/default.nix
Normal file
51
modules/home/programs/cheat/default.nix
Normal file
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
namespace,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib.${namespace}) mkEnableModule;
|
||||
|
||||
cfg = config.${namespace}.programs.cheat;
|
||||
inherit (config.${namespace}) theme;
|
||||
|
||||
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 = "${theme.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;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
{ 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;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue