!apXxbtexmNGJaAryzM:nixos.org

NixOS on WSL

339 Members
https://github.com/nix-community/NixOS-WSL58 Servers

Load older messages


SenderMessageTime
25 Nov 2022
@k900:0upti.meK900And of course it shoves it in a thread local17:23:42
@psvo:matrix.orgpsvothe locale is not UTF817:23:43
@k900:0upti.meK900I'm guessing touching any of the LC_ variables will make it reload the locale from disk17:24:03
@k900:0upti.meK900Thus defeating the point17:24:07
@psvo:matrix.orgpsvo

Well, you can break it even later:

CZsvobodpe02% export LC_ALL=C
CZsvobodpe02% echo '\u00a0'
zsh: character not in range
17:25:11
@k900:0upti.meK900Yeah but that's explicitly setting a non-UTF8 locale17:25:24
@k900:0upti.meK900Oh17:27:12
@k900:0upti.meK900I got it17:27:16
@k900:0upti.meK900I think17:27:24
@k900:0upti.meK900It looks like it's just shoved into the global systemd environment by default17:27:36
@k900:0upti.meK900But somehow that doesn't happen for WSL17:28:29
@k900:0upti.meK900And I think it might be because we're spawning it wrong maybe?17:29:43
@k900:0upti.meK900If this is the fix I am going to mcfuckingloseit17:32:18
@psvo:matrix.orgpsvoI'm not sure I follow - I don't have locale-related env vars in /proc/1/environ17:32:36
@k900:0upti.meK900EXACTLY17:34:38
@psvo:matrix.orgpsvohm, for consideration: I've just switched my default locale cs_CZ.UTF8, but the shell spawned by WSL /init is still having LANG=en_US.UTF-817:38:08
@k900:0upti.meK900Oh no17:38:19
@k900:0upti.meK900I think it's worse actually17:38:22
@k900:0upti.meK900LOCALE_ARCHIVE is normally set by PAM17:38:27
@k900:0upti.meK900But we don't have a PAM17:38:29
@psvo:matrix.orgpsvohm, seems the env is correct only for the bash spawn by the /bin/login, so I believe you are right17:40:43
@k900:0upti.meK900I wonder if it'll work if i set the environment on the systemd itself17:42:14
@k900:0upti.meK900Since technically the /init process is its child17:43:16
@psvo:matrix.orgpsvoit seem the locale is by /init17:44:05
@k900:0upti.meK900 Worst case, we can generate a horrible wrapper script to export environment.sessionVariables and then exec into the normal shell 17:44:11
@psvo:matrix.orgpsvo * it seem the locale is set by /init17:44:13
@k900:0upti.meK900Oh actually I don't think we can17:48:34
@k900:0upti.meK900That's fun17:48:35
@k900:0upti.meK900Because we have to do it for every user and NixOS modules don't like this kind of recursion17:48:48
@psvo:matrix.orgpsvobtw: https://learn.microsoft.com/en-us/windows/wsl/faq#how-do-i-change-the-display-language-of-wsl-17:51:14

Show newer messages


Back to Room ListRoom Version: 9