Both of the methods for installing rofi-emoji on NixOS either don’t work as expected or don’t work.
The first method using home-manager causes rofi to not open as a floating window (even if you set floating window rules in hyprland):
programs.rofi = {
enable = true;
plugins = [pkgs.rofi-emoji];
# ...
}
The next method using configuration.nix doesn’t work at all:
environment.systemPackages = [
# ...
(
pkgs.rofi.override (old: {
plugins = old.plugins ++ [pkgs.rofi-emoji];
})
)
# ...
];
This gives the following build error:
error: attribute 'plugins' missing
at /nix/store/k0kzgx40pa32672wwx29yizv97yg72gg-source/nixos/configuration.nix:355:23:
354| rofi.override (old: {
355| plugins = old.plugins ++ [pkgs.rofi-emoji];
| ^
356| })
Any suggestions? I wonder if this is a similar issue as this rofi-calc issue.
1 Like
Try rofi-wayland:
programs.rofi = {
enable = true;
package = pkgs.rofi-wayland;
plugins = [pkgs.rofi-emoji];
…
}
I added that to my home.nix config, but when I run rofi -modi emoji -show emoji
I get:
(process:382152): Rofi-WARNING **: 07:53:03.232: ABI version of plugin: 'emoji.so' does not match: 00000006 expecting: 00000007
Just to confirm, I should still have the following in my configuration.nix:
environment.systemPackages = with pkgs; [
rofi-emoji
rofi-wayland
];
I also tried:
programs.rofi = {
enable = true;
package = pkgs.rofi-wayland.override { plugins = [ pkgs.rofi-emoji ]; };
};
and got the same error.
The legacy rofi doesn’t support layer-shell (because it doesn’t support wayland).
To use rofi plugins with rofi-wayland (which isn’t abi compatible with rofi, but with rofi-git):
(rofi-emoji.override { rofi-unwrapped = rofi-wayland-unwrapped; })
Or if you don’t use legacy rofi at all, you can add an overlay:
final: prev: { rofi-unwrapped = prev.rofi-wayland-unwrapped; }
Hope it helps!
1 Like
Also not all rofi plugins needs an override, just for those built as a library.
I don’t use legacy rofi at all, but the overlay gives me infinite recursion encountered error.
The first method says “mode emoji was not found” in the rofi popup.
In case anyone stumbles on this, I followed justinlovinger’s suggestion and used
rofimoji instead. It was easier to setup and works great.
1 Like