Locale settings issue: man command requires `--language` but none was supplied

Hi,

when running man man (or man man --help) I get the following error:

error: a value is required for '--language <language>' but none was supplied

For more information, try '--help'.
/etc/profiles/per-user/rouven/bin/man: command exited with status 2: sed -e '/^[[:space:]]*$/{ N; /^[[:space:]]*\n[[:space:]]*$/D; }' | LESS=-ix8RmPm Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$PM Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$ MAN_PN=man(1) bat -l

In my NixOS configuration flake I have

i18n.defaultLocale = "en_US.UTF-8";

(and no other options related to locales, i18n, or languages that I could find).
The command locale outputs

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

while locale -a prints:

C
C.utf8
en_US.utf8
POSIX

I’m quite unsure what could be causing my issue.

I’m on NixOS unstable running on a Framework 16.

1 Like

The same for me but stable release and es_ES language

I found the issue: I had MANPAGER set (via home.sessionVariables) to "bat -l man'" (changed from the recommended value "sh -c 'col -bx | bat -l man -p'" which had some issues for me). Setting this instead to "bat -l man" solved the issue for me.