diff --git a/common/modules/bash/programs.nix b/common/modules/bash/programs.nix index bed8b2d2..e5143c2b 100644 --- a/common/modules/bash/programs.nix +++ b/common/modules/bash/programs.nix @@ -1,9 +1,10 @@ -{ ... }: { +{ pkgs, ... }: { programs = { fzf = { enable = true; enableBashIntegration = true; }; + ripgrep = { enable = true; arguments = [ @@ -16,7 +17,28 @@ "path" ]; }; + jq.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 + ]; + }; }; } diff --git a/common/modules/git.nix b/common/modules/git.nix index d0ee3703..7cbff666 100644 --- a/common/modules/git.nix +++ b/common/modules/git.nix @@ -13,6 +13,25 @@ includes = [ { 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; + }; }; }; } diff --git a/common/overlays/dracula-theme.nix b/common/overlays/dracula-theme.nix index c47367bb..46304ba2 100644 --- a/common/overlays/dracula-theme.nix +++ b/common/overlays/dracula-theme.nix @@ -15,6 +15,13 @@ hash = "sha256-3tKjKn5IHIByj+xgi2AIL1vZANlb0vlYJsPjH6BHGxM="; }; + bat-theme = pkgs.fetchFromGitHub { + owner = "matt1432"; + repo = "bat"; + rev = "270bce892537311ac92494a2a7663e3ecf772092"; + hash = "sha256-UyZ3WFfrEEBjtdb//5waVItmjKorkOiNGtu9eeB3lOw="; + }; + wallpaper = pkgs.fetchurl { url = "https://github.com/aynp/dracula-wallpapers/blob/main/Art/4k/Waves%201.png?raw=true"; hash = "sha256-f9FwSOSvqTeDj4bOjYUQ6TM+/carCD9o5dhg/MnP/lk="; @@ -43,6 +50,13 @@ in { mkdir -p $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 cp -a ${plymouth}/dracula ./dracula chmod 777 ./dracula