Mange / rofi-emoji

Emoji selector plugin for Rofi
MIT License
555 stars 26 forks source link

Nix: mode emoji is not found #25

Closed andys8 closed 3 years ago

andys8 commented 3 years ago

I did install rofi-emoji with nix package manager in arch. When I run rofi -show emoji -modi emoji it'll tell me "mode emoji is not found".

nix-env -i rofi rofi-emoji

I'm I missing something? Is this reproducible for others?

In addition I noticed it will have the same behavior if I install it in arch (via yay -S rofi-emoji rofi), but maybe I'm mixing it up with nix.

rofi v1.6.1
Mange commented 3 years ago

I do not use Nix, and I'm also not the author of the Nix package.

Try to run rofi -plugin-path /path/to/rofi-emoji/plugin -modi emoji -show emoji and see if that works. Perhaps Rofi is not set up to load from the correct directory?

It could also be that the package is using a different Rofi version when compiling the plugin than the version you use when you try to run it and Rofi silently ignores plugins it cannot load. (Just a guess)

MaeIsBad commented 3 years ago

The actual solution due to nix's purity is to overwrite the rofi package with one that includes the rofi-emoji plugin. You can do nix-shell -p '(rofi.override { plugins = [ rofi-emoji ]; })' to install it temporarily.

If you want to install stuff permanently you should override the package in ~/.config/nixpkgs/config.nix and then install it with nix-env. I've never used nix without nixos so I'm not sure how to do that, sorry.

On nixos to install rofi-emoji you need to add environment.systemPackages = [ pkgs.rofi.override { plugins = [ pkgs.rofi-emoji ]; }; ]; to your /etc/nixos/configuration.nix

Feel free to ask me if you have any other questions, or want me to explain in more detail. I'm by no means a nix expert but I'd be glad to help if I can

Mange commented 3 years ago

Thanks a lot!

I'll close this issue as its not a problem with the codebase, but feel free to keep using this issue to troubleshoot problems with the Nix package.

andys8 commented 3 years ago

@JustABanana That's awesome. Thanks for the help :)

prithvihv commented 2 years ago

Unable to build this with nix :cry:

error: builder for '/nix/store/3n87khzrcpqvy3pl6hh67z6df3digfqd-home-manager-path.drv' failed with exit code 255;
       last 1 log lines:
       > error: collision between `/nix/store/lyjkyw47r8xq7mi7vf3k7d5ss7k37wid-rofi-1.7.0/bin/rofi-theme-selector' and `/nix/store/anxn3ncf6m4j2l87zk9j25ljl4xdljnk-rofi-1.7.0/bin/rofi-theme-selector'
       For full logs, run 'nix log /nix/store/3n87khzrcpqvy3pl6hh67z6df3digfqd-home-manager-path.drv'.

@MaeIsBad any thoughts?

guemax commented 12 months ago

Unable to build this with nix 😢

error: builder for '/nix/store/3n87khzrcpqvy3pl6hh67z6df3digfqd-home-manager-path.drv' failed with exit code 255;
       last 1 log lines:
       > error: collision between `/nix/store/lyjkyw47r8xq7mi7vf3k7d5ss7k37wid-rofi-1.7.0/bin/rofi-theme-selector' and `/nix/store/anxn3ncf6m4j2l87zk9j25ljl4xdljnk-rofi-1.7.0/bin/rofi-theme-selector'
       For full logs, run 'nix log /nix/store/3n87khzrcpqvy3pl6hh67z6df3digfqd-home-manager-path.drv'.

@MaeIsBad any thoughts?

You might have already fixed this, but I wanted to share a solution with other as I also stumpled across this problem. Replace rofi in your system packages with (rofi.override { plugins = [ rofi-emoji ]; }) (enclosed in parentheses). My system packages now look like this:

environment.systemPackages = with pkgs; [
  # ...
  # rofi <-- Do not include this as well!
  (rofi.override { plugins = [ rofi-emoji ]; })
  # ...
];

Hope this helps!

Mange commented 12 months ago

:point_up: This is how I have it in my Nix config, too.

(Yeah, I've switched to Nix since after this issue was closed.)