feat: add localisation module
This commit is contained in:
28
modules/nixos/localisation.nix
Normal file
28
modules/nixos/localisation.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options = {
|
||||
localisation = {
|
||||
enable = lib.mkEnableOption "localisation defaults";
|
||||
|
||||
timeZone = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
|
||||
defaultLocale = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.localisation.enable {
|
||||
time.timeZone = config.localisation.timeZone;
|
||||
i18n.defaultLocale = config.localisation.defaultLocale;
|
||||
|
||||
# NOTE:(@janezicmatej) some apps (e.g. java) need TZ env var explicitly
|
||||
environment.variables.TZ = config.localisation.timeZone;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user