Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set defaultLocale with Japanese in NixOS layer again #886

Merged
merged 7 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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