Fcitx5 failing to compose letters with accents on Hyprland

First of all, hello! :slight_smile:
I’m new on NixOS (coming from Arch).

With fcitx5 set up from home-manager, I cannot type letters with accents (á, é, í, ó, ú, etc) nor the cedilla (ç) using the US intl. alt. keyboard layout.

The expected behaviour is, when the US intl. alt. layout is active, letters with accents and the cedilla should be composed thru fcitx5 with Wayland’s text-input on most applications. However, the actual behaviour is, when typing the ’ key to compose the letters, nothing happens, is typed nor is composed, as if I haven’t pressed anything on the keyboard (tested on Alacritty and Zen browser with Hyprland keyboard configured to us). On the other hand, when Hyprland keyboard layout configuration is set to us intl, I can type accents on Zen but not on Alacritty with Hyprland’s own composing mechanism independent of the active layout on fcitx5, which is not the intended behaviour. (If it helps, mozc functions normally for some reason.)

Does anyone know how can I properly configure fcixt5 and Hyprland to function normally?

Some important config files:
~/.config/hypr/hyprland.conf:

[...]
$imf = fcitx5 -rd
exec-once = $imf
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
[...]
input {
    kb_layout = us
    kb_variant =
    kb_model =
    kb_options =
    kb_rules =

    numlock_by_default = true
    [...]
}
[...]

~/.config/fcitx5/profile:

[Groups/0]
# Group Name
Name="Group 1"
# Layout
Default Layout=us
# Default Input Method
DefaultIM=keyboard-us

[Groups/0/Items/0]
# Name
Name=keyboard-us-alt-intl
# Layout
Layout=

[Groups/0/Items/1]
# Name
Name=keyboard-us
# Layout
Layout=

[Groups/0/Items/2]
# Name
Name=mozc
# Layout
Layout=

~/.config/fcitx5/config:

[Behavior]
# Active By Default
ActiveByDefault=False
# Reset state on Focus In
resetStateWhenFocusIn=No
# Share Input State
ShareInputState=No
# Show preedit in application
PreeditEnabledByDefault=True
# Show Input Method Information when switch input method
ShowInputMethodInformation=True
# Show Input Method Information when changing focus
showInputMethodInformationWhenFocusIn=False
# Show compact input method information
CompactInputMethodInformation=True
# Show first input method information
ShowFirstInputMethodInformation=True
# Default page size
DefaultPageSize=5
# Override Xkb Option
OverrideXkbOption=False
# Custom Xkb Option
CustomXkbOption=
# Force Enabled Addons
EnabledAddons=
# Force Disabled Addons
DisabledAddons=
# Preload input method to be used by default
PreloadInputMethod=True
# Allow input method in the password field
AllowInputMethodForPassword=False
# Show preedit text when typing password
ShowPreeditForPassword=False
# Interval of saving user data in minutes
AutoSavePeriod=30

~/dev/nix/nixos/modules/hyprland.nix: (~/dev/nix contains flake.nix and hyprland.nix is imported by configuration.nix)

{
  programs.hyprland.enable = true;
  programs.hyprland.xwayland.enable = true;
}

~/dev/nix/home-manager/modules/hyprland.nix: (imported from home.nix)

{pkgs, ...}:

{
  # some necessary packages for the config
  home.packages = with pkgs; [
    mako
    clipse
    hyprpaper
    grimblast
    playerctl
    brightnessctl
  ];

  # fcitx5
  i18n.inputMethod = {
    enabled = "fcitx5";
    #fcitx5.waylandFrontend = true;  # problem happens with and without this line
    fcitx5.addons = with pkgs; [ fcitx5-mozc ];
  };
}

If anything else is necessary, please tell me to edit and include the information.
Thanks in advance! :slight_smile:

i don’t know if it will help you or not but you can look at how i have set up fcitx5 in my nixos configuration and it works too… i just set it up yesterday. you can check the commit history to find the fcitx setup commit, btw.

Thanks for that, but didn’t help :confused:
Mozc works fine for me, the problem is with the us intl layout.

Investigating a bit more, I found this on fcitx5’s log when it’s starting:

D2025-03-03 23:29:49.587242 i18n.cpp:32] Add gettext domain fcitx5 at /nix/store/9pcj2b4c4vlif7lq3aaxca70zb41ar82-fcitx5-5.1.12/share/locale
I2025-03-03 23:29:49.587878 instance.cpp:178] Trying to fallback to compose table for en_US.UTF-8
W2025-03-03 23:29:49.588121 instance.cpp:185] No compose table is loaded, you may want to check your locale settings.

Seems like there is a problem with the locales, but I can’t find what.

# configuration.nix
console.keyMap = "us";
i18n = {
  defaultLocale = "pt_BR.UTF-8";
  supportedLocales = [ "C.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" "pt_BR.UTF-8/UTF-8" ];
};

Is there a problem with my config?

try only “all” in the supportedLocales and see if it works.