Locale failure when switching LC_TIME

I installed xfce nixos recently and am making minor changes.

I set il8n LC_TIME to en_CA in order to get yyyy-mm-dd date format as I am Canadian.

Not sure if was related but my libreoffice files were showing square boxes instead of letters so I switched LC… back to en_US. I’m ignoring this problem for a while and just dealing with locale.

I got the following warning that may be of interest to some.

erl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = (unset),
	LC_NUMERIC = "en_US.UTF-8",
	LC_COLLATE = (unset),
	LC_TIME = "en_CA.UTF-8",
	LC_MESSAGES = (unset),
	LC_MONETARY = "en_US.UTF-8",
	LC_ADDRESS = "en_US.UTF-8",
	LC_IDENTIFICATION = "en_US.UTF-8",
	LC_MEASUREMENT = "en_US.UTF-8",
	LC_PAPER = "en_US.UTF-8",
	LC_TELEPHONE = "en_US.UTF-8",
	LC_NAME = "en_US.UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
setting up /etc...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = (unset),
	LC_NUMERIC = "en_US.UTF-8",
	LC_COLLATE = (unset),
	LC_TIME = "en_CA.UTF-8",
	LC_MESSAGES = (unset),
	LC_MONETARY = "en_US.UTF-8",
	LC_ADDRESS = "en_US.UTF-8",
	LC_IDENTIFICATION = "en_US.UTF-8",
	LC_MEASUREMENT = "en_US.UTF-8",
	LC_PAPER = "en_US.UTF-8",
	LC_TELEPHONE = "en_US.UTF-8",
	LC_NAME = "en_US.UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").

Retyping en_CA and building again gave no warnings.

Bash: date _%x shows the short locale is US mm/dd/yyyy contrary to the nix file.

I want to set en_CA. Am I missing a step?

(As a note: The first time I set en_CA, I got pages and pages during the build. Too many to read and too many for the terminal to keep.)

Just to cover the basics, did you check the runtime environment variable before running that command?

Did you mean this?

[chris@nitrogen:~]$ env | grep LC
LC_ADDRESS=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8

or this?

[chris@nitrogen:~]$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=en_US.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=

I note that neither show en_CA as is currently in the built configuration.nix.

It is working now, however I am not sure if it was the reboot or some other configuration changes directly on applications done outside of the configuration.nix.