home: Use bat as pager for man

This commit is contained in:
Mikael 2024-10-03 21:43:28 +02:00
parent fc4fc2523d
commit 651c8b5a0f
Signed by: mikael
SSH key fingerprint: SHA256:21QyD2Meiot7jOUVitIR5YkGB/XuXdCvLW1hE6dsri0

View file

@ -1,6 +1,10 @@
{ self, nur, catppuccin, nix-index-database, niri, ripgrep-all, ... }: { config, lib, pkgs, ... }@args: { self, nur, catppuccin, nix-index-database, niri, ripgrep-all, ... }: { config, lib, pkgs, ... }@args:
let let
osConfig = args.osConfig or { }; osConfig = args.osConfig or { };
bat = lib.getExe config.programs.bat.package;
col = lib.getExe' pkgs.util-linux "col";
sh = lib.getExe self.packages.${pkgs.system}.hush;
in { in {
imports = [ imports = [
nur.hmModules.nur nur.hmModules.nur
@ -207,6 +211,8 @@ in {
load-env { load-env {
EDITOR: r#'${lib.getExe config.programs.helix.package}'# EDITOR: r#'${lib.getExe config.programs.helix.package}'#
LS_COLORS: r#'${ls-colours}'# LS_COLORS: r#'${ls-colours}'#
MANROFFOPT: `-c`
MANPAGER: `${sh} -c '${col} -bx | ${bat} -l man -p'`
PROMPT_COMMAND: { PROMPT_COMMAND: {
let dir = match (do --ignore-shell-errors { $env.PWD | path relative-to $nu.home-path }) { let dir = match (do --ignore-shell-errors { $env.PWD | path relative-to $nu.home-path }) {