nix-config/modules/home/pager/default.nix
Bruno BELANYI 7a7da21a27 home: pager: use upstream module
Only for the configuration, not `LESS`, as settings it through the
configuration file does not result in the behaviour I want in Git (and
probably other programs).
2026-04-01 20:04:43 +01:00

31 lines
638 B
Nix

{ config, lib, ... }:
let
cfg = config.my.home.pager;
in
{
options.my.home.pager = with lib; {
enable = my.mkDisableOption "pager configuration";
};
config = lib.mkIf cfg.enable {
programs.less = {
enable = true;
config = ''
#command
# Quit without clearing the screen on `Q`
Q toggle-option -!^Predraw-on-quit\nq
'';
};
home.sessionVariables = {
# My default pager
PAGER = "less";
# Clear the screen on start and exit
LESS = "-R -+X -c";
# Better XDG compliance
LESSHISTFILE = "${config.xdg.stateHome}/less/history";
};
};
}