title: NixOS: How to granularly configure locale settings?
body: <p>On my home laptop running NixOS 19.03, in <code>/etc/nixos/configuration.nix</code>, I use the default locale settings:</p>
  
  <pre><code>  i18n = {
      consoleFont = "Lat2-Terminus16";
      consoleKeyMap = "us";
      defaultLocale = "en_US.UTF-8";
    };
  </code></pre>
  
  <p>That's the only way I know to control locale settings in NixOS, and it's too broad. I want more granular control, so that I can use a mixture of US English and Colombian Spanish. (That's a consequence of my job, not a personal choice.) Specifically, I need these settings:</p>
  
  <pre><code>LANG=en_US.UTF-8
  LANGUAGE=
  LC_CTYPE="en_US.UTF-8"
  LC_NUMERIC=es_CO.UTF-8
  LC_TIME=es_CO.UTF-8
  LC_COLLATE="en_US.UTF-8"
  LC_MONETARY=es_CO.UTF-8
  LC_MESSAGES="en_US.UTF-8"
  LC_PAPER=es_CO.UTF-8
  LC_NAME=es_CO.UTF-8
  LC_ADDRESS=es_CO.UTF-8
  LC_TELEPHONE=es_CO.UTF-8
  LC_MEASUREMENT=es_CO.UTF-8
  LC_IDENTIFICATION=es_CO.UTF-8
  LC_ALL=
  </code></pre>
  
  <p>On my work desktop (running Ubuntu 18.04), if I evaluate <code>locale</code> in bash, that's what I see. On my home NixOS system, each of those variables is either set to US English or nothing:</p>
  
  <pre><code>[jeff@jbb-dell:~/nix-jbb]$ locale
  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=
  </code></pre>
  
  <p>I thought maybe I should edit <code>/etc/locale.conf</code>, copying the settings from my work system into it. But when (on the NixOS system) I print that file to screen, it doesn't include any of the above variables except <code>LANG</code>:</p>
  
  <pre><code>[jeff@jbb-dell:~/nix-jbb]$ cat /etc/locale.conf
  LANG=en_US.UTF-8
  
  [jeff@jbb-dell:~/nix-jbb]$
  </code></pre>
  
  <p>Therefore the other variables, like <code>LC_NUMERIC</code>, must be getting set somewhere else. I'm worried that if I edit <code>/etc/locale.conf</code> I'll break my system. Is editing that file the right way to set granular locale information in NixOS? And if not, what is?</p>