Skip to content

Commit

Permalink
Fix locale regression in GNOME (#886)
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick authored Oct 23, 2024
1 parent 675e56d commit 0ac564f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
8 changes: 3 additions & 5 deletions home-manager/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@
MANPAGER = "${lib.getExe pkgs.bashInteractive} -c '${pkgs.util-linux}/bin/col -bx | ${lib.getExe pkgs.bat} -l man -p'";
MANROFFOPT = "-c";

# - You can check the candidates in `locale -a`
# - pkgs.glibc installs many candidates, but it does not support darwin
# This value may overrides NixOS config for GNOME
# LANG = "en_US.UTF-8";

# NOTE: Original comments in zsh
# Mouse-wheel scrolling has been disabled by -X (disable screen clearing).
# Remove -X and -F (exit if the content fits on one screen) to enable it.
Expand Down Expand Up @@ -82,10 +77,13 @@
inherit homemade-pkgs;
};

# You can check the candidates in `locale -a`
# pkgs.glibc installs many candidates, but it does not support darwin
# https://wiki.archlinux.jp/index.php/%E3%83%AD%E3%82%B1%E3%83%BC%E3%83%AB
# https://github.com/nix-community/home-manager/blob/fe56302339bb28e3471632379d733547caec8103/modules/home-environment.nix#L11
language = {
base = "ja_JP.UTF-8";
# systemd config overrides this value in gnome-shell, however this will be used in Linux VT console
time = "en_DK.UTF-8"; # To prefer ISO 8601 format. See https://unix.stackexchange.com/questions/62316/why-is-there-no-euro-english-locale
};
};
Expand Down
8 changes: 8 additions & 0 deletions home-manager/systemd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
# https://github.com/nix-community/home-manager/blob/release-24.05/modules/systemd.nix#L161-L173
systemd = {
user = {
# Enable locale for GNOME and terminals in the gnome-shell. Linux VT console respects home.sessionVariables instead
# https://superuser.com/a/1841368
# https://github.com/nix-community/home-manager/blob/5ec753a1fc4454df9285d8b3ec0809234defb975/modules/systemd.nix#L92-L96
sessionVariables = {
# GNOME clock respects LC_TIME. And does not support displaying iso-8601 format even if set en_DK
LC_TIME = "ja_JP.UTF-8";
};

services.podman = {
Unit = {
Description = "Podman API Service";
Expand Down
5 changes: 5 additions & 0 deletions nixos/desktop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
};
};

i18n = {
# GNOME respects this, I don't know how to realize it only via home-manager
defaultLocale = "ja_JP.UTF-8";
};

services.xserver = {
enable = true;

Expand Down

0 comments on commit 0ac564f

Please sign in to comment.