1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-24 02:39:48 +01:00

home-environment: add full locale options support

Allows setting every locale option independently. Also fixes `LC_`
order to match the order of `locale` command output for better
reference.

PR #1278
This commit is contained in:
Jakub Fišer 2020-05-27 14:33:55 +02:00 committed by Robert Helgesson
parent ba91ac5948
commit 479274775f
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -16,11 +16,35 @@ let
'';
};
address = mkOption {
ctype = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for addresses.
Character classification category.
'';
};
numeric = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for numerical values.
'';
};
time = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for formatting times.
'';
};
collate = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for collation (alphabetical ordering).
'';
};
@ -32,6 +56,14 @@ let
'';
};
messages = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for messages, application UI languages, etc.
'';
};
paper = mkOption {
default = null;
type = types.nullOr types.str;
@ -40,13 +72,38 @@ let
'';
};
time = mkOption {
name = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for formatting times.
The language to use for personal names.
'';
};
address = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for addresses.
'';
};
telephone = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for telephone numbers.
'';
};
measurement = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for measurement values.
'';
};
};
};
@ -354,13 +411,27 @@ in
in
(maybeSet "LANG" cfg.language.base)
//
(maybeSet "LC_ADDRESS" cfg.language.address)
(maybeSet "LC_CTYPE" cfg.language.ctype)
//
(maybeSet "LC_NUMERIC" cfg.language.numeric)
//
(maybeSet "LC_TIME" cfg.language.time)
//
(maybeSet "LC_COLLATE" cfg.language.collate)
//
(maybeSet "LC_MONETARY" cfg.language.monetary)
//
(maybeSet "LC_MESSAGES" cfg.language.messages)
//
(maybeSet "LC_PAPER" cfg.language.paper)
//
(maybeSet "LC_TIME" cfg.language.time);
(maybeSet "LC_NAME" cfg.language.name)
//
(maybeSet "LC_ADDRESS" cfg.language.address)
//
(maybeSet "LC_TELEPHONE" cfg.language.telephone)
//
(maybeSet "LC_MEASUREMENT" cfg.language.measurement);
home.packages = [
# Provide a file holding all session variables.