2

I'm using the pass package for password management. The passmenu command that comes with it uses dmenu, but I'd like for it to use Rofi instead. I saw on the Arch wiki that it's possible to use rofi as a drop-in dmenu replacement, but the path structures of NixOS are so complex that I'm having a hard time figuring this out. Should I create a new package for it? Or is there a way to update the original pass package so that it uses rofi instead?

2
  • 1
    Firstly, have you tried rofi-pass (github.com/carnager/rofi-pass)? There's a Nix package for it. As for your question, the passmenu package takes dmenu as an optional argument. So, you can override the passmenu package to accept an alternative "dmenu" package. rofi takes on dmenu functionality when it's called via a symbolic link named dmenu, so you may be able to get away with a tiny dmenu-emulation package which simply symlinks to rofi. Then, you'd provide said package when overriding passmenu. Commented Sep 12, 2018 at 14:20
  • Awesome, that's just what I need. Commented Sep 13, 2018 at 1:24

2 Answers 2

0

For Arch there is a package in the AUR that symlinks dmenu to rofi. That makes the regular passmenu work with rofi instead: https://aur.archlinux.org/packages/rofi-dmenu

You could do the same yourself:

ln -s /usr/bin/rofi /usr/bin/dmenu
0

I got it working with the following code :

  environment.systemPackages = with pkgs; [
    rofi
    (pkgs.writeShellScriptBin "dmenu" ''
      # This script will simply execute rofi in dmenu mode
      # "$@" passes all arguments from the original dmenu call to rofi
      exec ${pkgs.rofi}/bin/rofi -dmenu "$@"
    '')
1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. Commented May 25 at 8:23

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.