about summary refs log tree commit diff
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2023-01-20 00:27:54 +0100
committeraszlig <aszlig@nix.build>2023-01-20 00:37:13 +0100
commit82b7be2138d5343937bd74e191cb502f5748e8bb (patch)
tree82d69bab964b61cef3c1df432f70ef5c668d1278
parentf8062954dbbd995bf88e009b7f8dea8615a22ac6 (diff)
profiles/base: Explicitly set locale categories
The default locale is en_US.UTF-8, but this also comes with a 12 hour
clock and a few other nuisances such as imperial units. So while I do
prefer a German locale I don't want things to be in the German
*language*, so setting something like de_DE.UTF-8 for LC_TIME doesn't
fly very well, since it could result in something like "Freitag, 20.
Januar".

To cope with this, I used the C locale to make sure that we get a 24h
clock and english week/month names. Similarily I do not want floats to
be formatted with a comma.

Signed-off-by: aszlig <aszlig@nix.build>
-rw-r--r--modules/user/aszlig/profiles/base.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/user/aszlig/profiles/base.nix b/modules/user/aszlig/profiles/base.nix
index 681a044a..52649cbd 100644
--- a/modules/user/aszlig/profiles/base.nix
+++ b/modules/user/aszlig/profiles/base.nix
@@ -16,6 +16,18 @@ in {
       experimental-features = [ "nix-command" "flakes" ];
     };
 
+    i18n.defaultLocale = "en_US.UTF-8";
+    i18n.extraLocaleSettings = {
+      LC_ADDRESS = "de_DE.UTF-8";
+      LC_MEASUREMENT = "de_DE.UTF-8";
+      LC_MONETARY = "de_DE.UTF-8";
+      LC_NAME = "de_DE.UTF-8";
+      LC_NUMERIC = "C.UTF-8";
+      LC_PAPER = "de_DE.UTF-8";
+      LC_TELEPHONE = "de_DE.UTF-8";
+      LC_TIME = "C.UTF-8";
+    };
+
     users.defaultUserShell = "/var/run/current-system/sw/bin/zsh";
 
     networking.wireless.enable = false;