diff --git a/default.nix b/default.nix index 65ab9a8..feec78f 100644 --- a/default.nix +++ b/default.nix @@ -13,8 +13,6 @@ in { }; }; - imports = [] ++ - (optionals cfg.enable ([] - ++ optionals cfg.enableLocale [./modules/localisation.nix] - )); + imports = [./modules/localisation.nix] + ; } diff --git a/modules/localisation.nix b/modules/localisation.nix index 1ad7e81..43593d8 100644 --- a/modules/localisation.nix +++ b/modules/localisation.nix @@ -1,25 +1,29 @@ -{ - time.timeZone = "Europe/Berlin"; +{ config, lib, ... }: let + cfg = config.grimmShared; +in { + config = with cfg; lib.mkIf (enable && enableLocale) { + time.timeZone = "Europe/Berlin"; - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; - i18n.extraLocaleSettings = { - LC_ADDRESS = "de_DE.UTF-8"; - LC_IDENTIFICATION = "de_DE.UTF-8"; - LC_MEASUREMENT = "de_DE.UTF-8"; - LC_MONETARY = "de_DE.UTF-8"; - LC_NAME = "de_DE.UTF-8"; - LC_NUMERIC = "de_DE.UTF-8"; - LC_PAPER = "de_DE.UTF-8"; - LC_TELEPHONE = "de_DE.UTF-8"; - LC_TIME = "de_DE.UTF-8"; - }; + console.keyMap = "de"; - console.keyMap = "de"; - - services.xserver.xkb = { - layout = "de"; - variant = ""; + services.xserver.xkb = { + layout = "de"; + variant = ""; + }; }; }