Skip to content

Commit

Permalink
nixos/system/env: add pager configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Jul 24, 2024
1 parent 08355c1 commit b8a9911
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions modules/nixos/system/env/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ let
mapAttrs
;

pagerArgs = [
"--RAW-CONTROL-CHARS" # Only allow colors.
"--wheel-lines=5"
"--LONG-PROMPT"
"--no-vbell"
" --wordwrap" # Wrap lines at spaces.
];

cfg = config.${namespace}.system.env;
in
{
Expand Down Expand Up @@ -57,6 +65,19 @@ in
# Make some programs "XDG" compliant.
LESSHISTFILE = "$XDG_CACHE_HOME/less.history";
WGETRC = "$XDG_CONFIG_HOME/wgetrc";

MANPAGER = "nvim -c 'set ft=man bt=nowrite noswapfile nobk shada=\\\"NONE\\\" ro noma' +Man! -o -";
SYSTEMD_PAGERSECURE = "true";
PAGER = "less -FR";
LESS = concatStringsSep " " pagerArgs;
SYSTEMD_LESS = concatStringsSep " " (
pagerArgs
++ [
"--quit-if-one-screen"
"--chop-long-lines"
"--no-init" # Keep content after quit.
]
);
};
};
};
Expand Down

0 comments on commit b8a9911

Please sign in to comment.