Error when upgrading NixOS related to fcitx-engines

I use NixOS with Xmonad as my window manager. I’m trying to upgrade nixpkgs, and came across an error that I’m not sure how to track down:

building '/nix/store/j51h66lf0hzjsls3brid2dp2yk77jj5z-cabal2nix-xmonad.drv'...
error: fcitx-engines is deprecated, please use fcitx5 instead.

I use the version of Xmonad from nixpkgs, so I was surprised this caught me. I can’t immediately see where this is used, though my guess is in some Xmonad dependency. I’ll try investigate that later, but for now I thought I’d ask if anyone else has run into this or has some ideas on how to fix it.

For reference here’s my flake at the broken commit: [broken] build fails for xmonad stuff · d4hines/beth@d2b2a94 · GitHub

Thanks

For kicks I tried adding i18n.inputMethod.enabled = "fcitx5"; to my system config, but this appeared to have no effect.

I’ve got the same error when going from 22.11 to nixos-unstable.
Using NixOS and i3wm.

In your config, where are you pulling in and enabling xmonad? Do you get any interesting debug output with --show-trace?

Also, if possible, could you make a minimal reproducer? (I don’t really want to build your whole nixos machine just to try to debug a single xmonad error…)

edit: Oh, also, it could be that you’re getting two separate, unrelated errors from Nix, one about xmonad, and one about fcitx.

I’m also seeing this in darwin-x86_64 and darwin-aarch64 with home-manager, which is odd as I don’t believe i18n is supported on darwin. On NixOS (where I run Monad) I’m not having this issue when using more or less the same config.

Nothing noteworthy in --show-trace.

I now changed home-manager to master
sudo nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
as suggested in the home-mananger manual here in conjunction with nixos-unstable channel.

Now it seems to work without error

Doh! That’s been on my todo list. I’ll try that when I get home and report back.

Hi there! I did that, but the issue still exists :frowning:

I’m trying to upgrade NixOS from 22.11 to nixos-unstable.

The following added to the configuration.nix solved the issue for me.

nixpkgs.overlays = [
    (self: super: {
      fcitx-engines = fcitx5;
    })
  ];
1 Like

Hi, I have the same issue but with adding your code I am getting the following error:

error: undefined variable 'fcitx5' at /nix/store/hrimb69qsjy3ygnn8dmz12lchzg4bm11-source/overlays/default.nix:27:23:
           26|     (self: super: {
           27|       fcitx-engines = fcitx5;
             |                       ^
           28|     })

Did I forget something?.. Thanks for your help!

Hi @ocelik94, try using self.fcitx5 instead of fcitx5. Otherwise NixOS has no way of knowing where the fcitx5 package should come from.

1 Like

Oh, sorry, I forget to include with pkgs; into the example. I believe you can use pkgs.fcitx5 if your configuration.nix starts with something like the following: { pkgs, ... }.

1 Like

Yup, this seems to have been all I needed to do in my case. Thanks!

In my case, configuration.nix had this:

  home-manager.users.matt = import /home/matt/.config/nixpkgs/home.nix;

So I had to put

  nixpkgs.overlays = [
    (self: super: {
      fcitx-engines = pkgs.fcitx5;
    })
  ];

in ~/.config/nixpkgs/home.nix instead.

fwiw, if you are using home-manager as input flake for NixOS configuration, I’d do this:

    home-manager = {
      url = "github:nix-community/home-manager/release-23.05";
      inputs.nixpkgs.follows = "nixpkgs";
    };
1 Like