2024-11-16 12:21:24 -08:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
2024-11-16 23:29:38 -08:00
|
|
|
inherit (lib) mkEnableOption mkIf;
|
|
|
|
inherit (lib.marleyos) enabled;
|
2024-11-16 12:21:24 -08:00
|
|
|
|
2024-11-16 22:34:40 -08:00
|
|
|
cfg = config.marleyos.programs.bat;
|
|
|
|
inherit (config.marleyos.theme) colors;
|
2024-11-16 12:21:24 -08:00
|
|
|
in
|
|
|
|
{
|
2024-11-16 23:29:38 -08:00
|
|
|
options.marleyos.programs.bat = mkEnableOption "bat";
|
2024-11-16 12:21:24 -08:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
programs.bat = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
extraPackages = with pkgs.bat-extras; [
|
|
|
|
batdiff
|
|
|
|
batman
|
|
|
|
];
|
|
|
|
|
2024-11-16 22:44:45 -08:00
|
|
|
rose-pine = mkIf colors.isRosePine enabled;
|
2024-11-16 12:21:24 -08:00
|
|
|
|
|
|
|
config = {
|
|
|
|
style = "auto";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
home.sessionVariables = lib.mkIf config.programs.git.delta.enable {
|
|
|
|
BATDIFF_USE_DELTA = "true";
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.fish = lib.mkIf config.programs.fish.enable {
|
|
|
|
functions = {
|
|
|
|
cat = {
|
|
|
|
wraps = "bat";
|
|
|
|
body = # fish
|
|
|
|
"bat $argv";
|
|
|
|
};
|
|
|
|
|
|
|
|
cath = {
|
|
|
|
wraps = "bat";
|
|
|
|
body = # fish
|
|
|
|
"bat --plain --language=help $argv";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
home.shellAbbrs = {
|
|
|
|
B = {
|
|
|
|
position = "anywhere";
|
|
|
|
setCursor = true;
|
|
|
|
expansion = # fish
|
|
|
|
"% | bat";
|
|
|
|
};
|
|
|
|
|
|
|
|
"-h" = {
|
|
|
|
position = "anywhere";
|
|
|
|
expansion = # fish
|
|
|
|
"-h | cath";
|
|
|
|
};
|
|
|
|
|
|
|
|
"--help" = {
|
|
|
|
position = "anywhere";
|
|
|
|
expansion = # fish
|
|
|
|
"--help | cath";
|
|
|
|
};
|
|
|
|
|
|
|
|
help = {
|
|
|
|
position = "anywhere";
|
|
|
|
expansion = # fish
|
|
|
|
"help | cath";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|