diff options
author | Alexander V. Nikolaev <avn@avnik.info> | 2017-02-02 08:58:32 +0200 |
---|---|---|
committer | Alexander V. Nikolaev <avn@avnik.info> | 2017-02-06 07:30:15 +0200 |
commit | 2c54fa04be3fe64f7934a31d3469773b13bd3a5d (patch) | |
tree | cde57c9d790aab9e60fec2724561ef8e85b90f3c /nixos/modules/config/i18n.nix | |
parent | 8c406044596fc5a5a6fbdcbdaf06527b0c375a5c (diff) |
nixos: allow supply customized locale package
Overriding ``glibcLocales`` via nixpkgs.overlays not works,
so I added i18n.glibcLocales parameter, defaulted with
old override, using i18n.supportedLocales.
Diffstat (limited to 'nixos/modules/config/i18n.nix')
-rw-r--r-- | nixos/modules/config/i18n.nix | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/nixos/modules/config/i18n.nix b/nixos/modules/config/i18n.nix index 799f0793c74f..65ef95127805 100644 --- a/nixos/modules/config/i18n.nix +++ b/nixos/modules/config/i18n.nix @@ -2,21 +2,27 @@ with lib; -let - - glibcLocales = pkgs.glibcLocales.override { - allLocales = any (x: x == "all") config.i18n.supportedLocales; - locales = config.i18n.supportedLocales; - }; - -in - { ###### interface options = { i18n = { + glibcLocales = mkOption { + type = types.path; + default = pkgs.glibcLocales.override { + allLocales = any (x: x == "all") config.i18n.supportedLocales; + locales = config.i18n.supportedLocales; + }; + example = literalExample "pkgs.glibcLocales"; + description = '' + Customized pkg.glibcLocales package. + + Changing this option can disable handling of i18n.defaultLocale + and supportedLocale. + ''; + }; + defaultLocale = mkOption { type = types.str; default = "en_US.UTF-8"; @@ -118,7 +124,7 @@ in ''); environment.systemPackages = - optional (config.i18n.supportedLocales != []) glibcLocales; + optional (config.i18n.supportedLocales != []) config.i18n.glibcLocales; environment.sessionVariables = { LANG = config.i18n.defaultLocale; @@ -126,7 +132,7 @@ in }; systemd.globalEnvironment = mkIf (config.i18n.supportedLocales != []) { - LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; + LOCALE_ARCHIVE = "${config.i18n.glibcLocales}/lib/locale/locale-archive"; }; # ‘/etc/locale.conf’ is used by systemd. |