Open JonathanReeve opened 2 years ago
I did a bit of digging into this, and it appears that if I unset i18n.defaultLocale
, making it the default value instead, it builds fine. So it really doesn't like defaultLocale = "eo";
or defaultLocale = "eo.utf-8"
. I'll change the title of this issue to reflect that
Checking git blame
here to figure out whom to contact. @dasJ , @rnhmjoj , @ju1m : do you know what could be causing this? I suspect it's because "eo" is one of the only languages that doesn't have a region, so the Nixpkgs logic for handing it breaks.
This is a rather serious error, because it means that no one can use NixOS in this language.
I thought that since eo
doesn't end with UTF-8
, kbd_mode ${if isUnicode then "-u" else "-a"} -C /dev/console
actually enforces ASCII, which Esperanto apparently isn't.
@JonathanReeve have you tried building against a recent commit of nixpkgs?
Building the following with nixos-rebuild build-vm --flake path:(pwd)#esperanto
seems to work for me:
{
inputs = {
nixpkgs = { url = "github:nixos/nixpkgs/nixos-unstable-small"; };
};
outputs = { self, nixpkgs, ... }:
let
nixosSystem = args: nixpkgs.lib.nixosSystem (args // rec {
system = args.system or "x86_64-linux";
modules = assert (builtins.isList args.modules); [
({ ... }: {
i18n.defaultLocale = "eo";
console.keyMap = "colemak";
programs.fish.enable = true;
services.getty.autologinUser = "root";
})
] ++ args.modules;
});
in
{
nixosConfigurations = {
esperanto = nixosSystem {
modules = [];
};
};
};
}
@gravndal For me, the latest nixos-unstable
still doesn't work. I had to add something like this to nixpkgs to be able to switch to Esperanto:
@wegank that's a shame, then that flake.nix is insufficient to reproduce as it also builds against nixos-unstable
...
Though as Esperanto's not the only utf8 locale without the .UTF-8
suffix, that isUnicode
predicate really does seem overly naive.
@gravndal, it still doesn't work for me, on unstable, with all the latest updates. I've just updated my dotfiles if you want to see whether there are any irregularities there, but I suspect it's something with the locales. Maybe unstable-small isn't building the locales? I don't know enough about it to be able to tell.
For what it's worth, it'd be great to throw in @wegank 's fix above, at least as a stopgap measure.
@gravndal I guess we can patch it like this?
glibcSupportedLocales = pkgs.runCommand "glibc-supported-locales" { } ''
unpackFile ${pkgs.glibc.src}
cat glibc-2*/localedata/SUPPORTED | grep ' \\' | sort -u > $out
'';
isUnicode = elem "${toUpper config.i18n.defaultLocale}/UTF-8" (
splitString " \\\n" (toUpper (readFile "${glibcSupportedLocales}"))
);
@JonathanReeve nah, unstable and unstable-small weren't that far apart yesterday so that shouldn't really matter. I was just asking as I can't reproduce with my own configuration (and yours depends on your local fork of home-manager which I was feeling to lazy to sort out at the time :))
@wegank fwiw I was referring to the existing code and not your fix when calling it naive, though apologies if that's how you read that.
@gravndal I'm using a French keyboard, having emdash
as a non-ASCII keysym. Could you please test adding services.xserver.layout = "fr";
?
By the way, the code above has an IFD, which is not allowed in nixpkgs...
@wegank still doesn't cause any errors
Edit: what's your console.keyMap
?
@gravndal Oh, I use console.useXkbConfig = true;
.
@wegank that triggers it
@wegank why did you reopen the issue? Did the PR not fix it?
Oh, I didn't know because that was silently pushed to master.
Describe the bug
NixOS fails to rebuild, with this error:
Here's the full log, as provided by
nix log
:I'm not doing anything differently. It just started throwing this error. I'm not setting key symbols anywhere.
My config is here and in the files in that directory.
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
I expect it not to throw the error above, but to build.
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.