From 9f3ec54a87581c0ed716e692b0a3b0725c2b65a9 Mon Sep 17 00:00:00 2001 From: cerberus Date: Thu, 20 Nov 2025 16:44:58 +0100 Subject: [PATCH] moved locales and languages to locale.nix --- nixos/configuration.nix | 30 +----------------------------- nixos/modules/system/locale.nix | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 29 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 32dcef3..3c3918c 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -1,9 +1,9 @@ {pkgs, ...}: { imports = [ - # Include the results of the hardware scan. ./hardware-configuration.nix ./modules/users/users.nix ./modules/system/networking.nix + ./modules/system/locale.nix ]; # Bootloader. @@ -16,34 +16,6 @@ # Use latest kernel. boot.kernelPackages = pkgs.linuxPackages_latest; - - # Set your time zone. - time.timeZone = "Europe/Berlin"; - - # 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"; - }; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "de"; - variant = ""; - }; - - # Configure console keymap - console.keyMap = "de"; - # Allow unfree packages nixpkgs.config.allowUnfree = true; diff --git a/nixos/modules/system/locale.nix b/nixos/modules/system/locale.nix index e69de29..f4e97ed 100644 --- a/nixos/modules/system/locale.nix +++ b/nixos/modules/system/locale.nix @@ -0,0 +1,23 @@ +{ + config, + ... +}: { + time.timeZone = "Europe/Berlin"; + + i18n = { + defaultLocale = "en_US.UTF-8"; + 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"; +}