diff options
author | Michael Raskin <7c6f434c@mail.ru> | 2017-04-30 18:19:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-30 18:19:31 +0200 |
commit | a5d36429dc583cbe73bb90b03d1d5379db01be6d (patch) | |
tree | 46cd676169d35ec30136230b724f59d35731abc0 /nixos/modules/config | |
parent | 5628cebcf0bd8f36c7d87b2cfa7b6b07768abc08 (diff) | |
parent | 2c54fa04be3fe64f7934a31d3469773b13bd3a5d (diff) | |
download | nixpkgs-a5d36429dc583cbe73bb90b03d1d5379db01be6d.tar nixpkgs-a5d36429dc583cbe73bb90b03d1d5379db01be6d.tar.gz nixpkgs-a5d36429dc583cbe73bb90b03d1d5379db01be6d.tar.bz2 nixpkgs-a5d36429dc583cbe73bb90b03d1d5379db01be6d.tar.lz nixpkgs-a5d36429dc583cbe73bb90b03d1d5379db01be6d.tar.xz nixpkgs-a5d36429dc583cbe73bb90b03d1d5379db01be6d.tar.zst nixpkgs-a5d36429dc583cbe73bb90b03d1d5379db01be6d.zip |
Merge pull request #22489 from avnik/nixos-locales
nixos: allow supply customized locale package
Diffstat (limited to 'nixos/modules/config')
-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 799f0793c74..65ef9512780 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. |