NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.21k stars 14.21k forks source link

Euro symbol not displayed on console (consider adding console.keyMapToggle) #301419

Open YievCkim opened 7 months ago

YievCkim commented 7 months ago

Describe the bug

There is no straightforward way to get euro symbol in nixos console.

In classic Linux distribution (as Arch Linux) it is possible to set option KEYMAP_TOGGLE to "euro2" but this option doesn't exists in console.

This configuration can be done with localectl set-keymap too but this is not allowed on Nixos.

I tried several workaround found on the internet nothing works. On X and Xayland the symbol appears but not on virtual console. This is error prone especially on password setup, since input are hidden to the user when prompted.

Steps To Reproduce

Steps to reproduce the behavior:

  1. try to produce an euro symbol from the virtual console with a keyboard layout allowing this,

Expected behavior

Having the possibility to set keymap toggle from nixos configuration. This is I think the best solution.

Or something else if you want...

Notify maintainers

@l0b0 @rnhmjoj @Artturin

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.82, NixOS, 23.11 (Tapir), 23.11.5648.44733514b72e`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(mik): `""`
 - channels(root): `"home-manager-23.11.tar.gz, nixos-23.11, nixos-unstable"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a :+1: reaction to issues you find important.

YievCkim commented 7 months ago

I tried console.useXkbConfig it works if i switch to a virtual console directly after the rebuild. It displays the euro symbol. But it stops working on the first reboot.

rnhmjoj commented 7 months ago

In classic Linux distribution (as Arch Linux) it is possible to set option KEYMAP_TOGGLE to "euro2" but this option doesn't exists in console.

Of course it does: console.keyMap = "euro2".

This configuration can be done with localectl set-keymap too but this is not allowed on Nixos.

I have no idea what localectl set-keymap is supposed to do. In any case, you don't need systemd to do that. If you want to quickly change the keymap just do sudo loadkeys euro2.

YievCkim commented 6 months ago

Of course it does: console.keyMap = "euro2".

Ok so how can I choose a fr (or something else) layout with euro symbol ? keymap and keymap toggle are two different options.

YievCkim commented 6 months ago

I have no idea what localectl set-keymap is supposed to do. In any case, you don't need systemd to do that. If you want to quickly change the keymap just do sudo loadkeys euro2.

I've Just tried loadkeys euro2 directly from console and euro symbol is still not present with this configuration and another symbol (a vertical bar with to 2 horizontals, I don't know what is this symbol) is displayed instead.

YievCkim commented 6 months ago

this is exactly what I need to do on arch linux, you will see I need 2 different options to set the keyboard layout in console KEYMAP and KEYMAP_TOGGLE:

KEYMAP=fr-latin9
FONT=eurlatgr
XKBLAYOUT=fr
KEYMAP_TOGGLE=euro2
XKBMODEL=pc105
XKBVARIANT=latin9
XKBOPTIONS=terminate:ctrl_alt_bksp