feat: add bat, batman and delta to common shell commands

This commit is contained in:
matt1432 2023-10-20 16:22:28 -04:00
parent 4c180c599d
commit 974a34fecb
3 changed files with 56 additions and 1 deletions

View file

@ -1,9 +1,10 @@
{ ... }: { { pkgs, ... }: {
programs = { programs = {
fzf = { fzf = {
enable = true; enable = true;
enableBashIntegration = true; enableBashIntegration = true;
}; };
ripgrep = { ripgrep = {
enable = true; enable = true;
arguments = [ arguments = [
@ -16,7 +17,28 @@
"path" "path"
]; ];
}; };
jq.enable = true; jq.enable = true;
htop.enable = true; htop.enable = true;
bash.shellAliases = {
cat = "bat ";
man = "BAT_THEME='default' batman ";
};
bat = {
enable = true;
config = {
theme = "dracula-bat";
};
themes = {
dracula-bat = {
src = "${pkgs.dracula-theme}/bat";
file = "dracula-bat.tmTheme";
};
};
extraPackages = with pkgs.bat-extras; [
batman
];
};
}; };
} }

View file

@ -13,6 +13,25 @@
includes = [ includes = [
{ path = "${pkgs.dracula-theme}/git-colors"; } { path = "${pkgs.dracula-theme}/git-colors"; }
]; ];
delta = {
enable = true;
options = {
side-by-side = true;
line-numbers-zero-style = "#E6EDF3"; #BD93F9";
};
};
# https://github.com/dandavison/delta/issues/630#issuecomment-860046929
extraConfig.pager = let
cmd = "LESS='LRc --mouse' ${pkgs.delta}/bin/delta";
in {
diff = cmd;
show = cmd;
stash = cmd;
log = cmd;
reflog = cmd;
};
}; };
}; };
} }

View file

@ -15,6 +15,13 @@
hash = "sha256-3tKjKn5IHIByj+xgi2AIL1vZANlb0vlYJsPjH6BHGxM="; hash = "sha256-3tKjKn5IHIByj+xgi2AIL1vZANlb0vlYJsPjH6BHGxM=";
}; };
bat-theme = pkgs.fetchFromGitHub {
owner = "matt1432";
repo = "bat";
rev = "270bce892537311ac92494a2a7663e3ecf772092";
hash = "sha256-UyZ3WFfrEEBjtdb//5waVItmjKorkOiNGtu9eeB3lOw=";
};
wallpaper = pkgs.fetchurl { wallpaper = pkgs.fetchurl {
url = "https://github.com/aynp/dracula-wallpapers/blob/main/Art/4k/Waves%201.png?raw=true"; url = "https://github.com/aynp/dracula-wallpapers/blob/main/Art/4k/Waves%201.png?raw=true";
hash = "sha256-f9FwSOSvqTeDj4bOjYUQ6TM+/carCD9o5dhg/MnP/lk="; hash = "sha256-f9FwSOSvqTeDj4bOjYUQ6TM+/carCD9o5dhg/MnP/lk=";
@ -43,6 +50,13 @@ in {
mkdir -p $out mkdir -p $out
cp -a ./git-colors $out cp -a ./git-colors $out
# Bat colors
mkdir -p ./bat $out/bat
cp -a ${bat-theme}/Dracula.tmTheme ./bat/dracula-bat.tmTheme
chmod 777 ./bat/dracula-bat.tmTheme
cp -a ./bat/dracula-bat.tmTheme $out/bat
# Plymouth # Plymouth
cp -a ${plymouth}/dracula ./dracula cp -a ${plymouth}/dracula ./dracula
chmod 777 ./dracula chmod 777 ./dracula