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?
-
1Firstly, 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.Emmanuel Rosa– Emmanuel Rosa2018-09-12 14:20:54 +00:00Commented Sep 12, 2018 at 14:20
-
Awesome, that's just what I need.Jonathan– Jonathan2018-09-13 01:24:56 +00:00Commented Sep 13, 2018 at 1:24
Add a comment
|
2 Answers
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
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 "$@"
'')
-
1Your 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.2025-05-25 08:23:48 +00:00Commented May 25 at 8:23