# Missing locales in cronjob

**URL:** https://discourse.nixos.org/t/missing-locales-in-cronjob/2421
**Category:** Help
**Created:** [March 15, 2019, 11:00am UTC](https://discourse.nixos.org/t/missing-locales-in-cronjob/2421 "2019-03-15T11:00:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rkoe](https://discourse.nixos.org/user_avatar/discourse.nixos.org/rkoe/32/107_2.png) [@rkoe](https://discourse.nixos.org/u/rkoe)
#### Post date: [March 15, 2019, 11:00am UTC](https://discourse.nixos.org/t/missing-locales-in-cronjob/2421/1 "2019-03-15T11:00:03Z")

</div>

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:

- but when I run `locale -a` in a cronjob, I get:

---

<div class="post-metadata">

### Author: ![nomeata](https://discourse.nixos.org/user_avatar/discourse.nixos.org/nomeata/32/3624_2.png) [@nomeata](https://discourse.nixos.org/u/nomeata)
#### Post date: [February 23, 2023, 6:53am UTC](https://discourse.nixos.org/t/missing-locales-in-cronjob/2421/2 "2023-02-23T06:53:35Z")

</div>

Hitting this as well, so still a thing on 22.11  
Also see [Cron: locale to en\_US.UTF-8 ... failed · Issue #48642 · NixOS/nixpkgs · GitHub](https://github.com/NixOS/nixpkgs/issues/48642)
