Missing locales in cronjob


#1

In cronjobs, the locale is wrong:

  • The locale is set to POSIX instead of the configured defaultLocale
  • Only locales C and POSIX are available, and all others are missing.

How can this be fixed? And is this a known bug?

Details:

  • /etc/nixos/configuration.nix: defaultLocale = "en_DK.UTF-8";

  • $ locale -a:

    C
    de_DE.utf8
    en_DK.utf8
    en_GB.utf8
    en_US.utf8
    POSIX
    
  • but when I run locale -a in a cronjob, I get:

    C
    POSIX