Skip to content

Commit

Permalink
Adjust locale setting especially to fix Tofu in VT
Browse files Browse the repository at this point in the history
* Prefer Eglish for system default
* Ensure ASCII in Linux VT console
* Prefer ISO 8601 date format with en_DK hack
  • Loading branch information
kachick committed Oct 20, 2024
1 parent 4561a84 commit 7805db0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
1 change: 1 addition & 0 deletions home-manager/bash.nix
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
source "${homemade-pkgs.posix_shared_functions}"
if [ 'linux' = "$TERM" ]; then
export LANG=C # Avoid Tofu
disable_blinking_cursor
fi
''
Expand Down
7 changes: 7 additions & 0 deletions home-manager/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@
inherit edge-pkgs;
inherit homemade-pkgs;
};

# 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";
time = "en_DK.UTF-8"; # To prefer ISO 8601 format. See https://unix.stackexchange.com/questions/62316/why-is-there-no-euro-english-locale
};
};

# Let Home Manager install and manage itself.
Expand Down
1 change: 1 addition & 0 deletions home-manager/zsh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ in
source_sh "${homemade-pkgs.posix_shared_functions}"
if [ 'linux' = "$TERM" ]; then
export LANG=C # Avoid Tofu
disable_blinking_cursor
fi
Expand Down
15 changes: 2 additions & 13 deletions nixos/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -168,21 +168,10 @@
};
};

# TODO: Reconsider to set C or EN for servers
# Select internationalisation properties.
i18n = {
defaultLocale = "ja_JP.UTF-8";

extraLocaleSettings = {
LC_ADDRESS = "ja_JP.UTF-8";
LC_IDENTIFICATION = "ja_JP.UTF-8";
LC_MEASUREMENT = "ja_JP.UTF-8";
LC_MONETARY = "ja_JP.UTF-8";
LC_NAME = "ja_JP.UTF-8";
LC_NUMERIC = "ja_JP.UTF-8";
LC_PAPER = "ja_JP.UTF-8";
LC_TELEPHONE = "ja_JP.UTF-8";
LC_TIME = "ja_JP.UTF-8";
# https://wiki.archlinux.jp/index.php/%E3%83%AD%E3%82%B1%E3%83%BC%E3%83%AB
LC_TIME = "en_DK.UTF-8"; # To prefer ISO 8601 format. See https://unix.stackexchange.com/questions/62316/why-is-there-no-euro-english-locale
};
};
}

0 comments on commit 7805db0

Please sign in to comment.