summaryrefslogtreecommitdiff
path: root/system-profiles/default-locale.nix
blob: 68bc4240f805fb013bd93b65ed52f065eb03aef5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ pkgs, lib, options, config, ... }:

{
  config = lib.foldr lib.recursiveUpdate {} ([
    {
      i18n = {
        defaultLocale = "en_SE.UTF-8";

        glibcLocales =
          (pkgs.glibcLocales.override {
            allLocales = false;
            locales = config.i18n.supportedLocales;
          }).overrideAttrs (_: {
            postUnpack = ''
              cp ${pkgs.fetchurl {
                url = "https://gist.githubusercontent.com/bmaupin/d64368e78cd359d309685fecbe2baf23/raw/e933a0fc2e727aa640f4a1cb1f699622876940fc/en_SE";
                hash = "sha256-ArXL+rMDVWI4Mmcw8xoRlZFXhEeSQL0tLJf5pKEOx3s=";
              }} $sourceRoot/localedata/locales/en_SE
              echo 'en_SE.UTF-8/UTF-8 \' >> $sourceRoot/localedata/SUPPORTED
            '';
          });
      };
    }
  ] ++ (lib.optional (options ? i18n.extraLocales) {
    i18n.extraLocales = [ "C.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" ];
  }) ++ (lib.optional (!(options ? i18n.extraLocales)) {
    i18n.supportedLocales = [ "C.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" ];
  }));
}