Skip to content

Commit

Permalink
pass: seperate dmenu from x11Support
Browse files Browse the repository at this point in the history
  • Loading branch information
Vonfry committed Nov 25, 2020
1 parent b3a8771 commit 118695a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
17 changes: 10 additions & 7 deletions pkgs/tools/security/pass/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
, qrencode , makeWrapper, pass, symlinkJoin

, xclip ? null, xdotool ? null, dmenu ? null
, x11Support ? !stdenv.isDarwin
, x11Support ? !stdenv.isDarwin , dmenuSupport ? x11Support
, waylandSupport ? false, wl-clipboard ? null

# For backwards-compatibility
Expand All @@ -12,9 +12,11 @@

with lib;

assert x11Support -> xclip != null
&& xdotool != null
&& dmenu != null;
assert x11Support -> xclip != null;

assert dmenuSupport -> dmenu != null
&& xdotool != null
&& x11Support;

assert waylandSupport -> wl-clipboard != null;

Expand Down Expand Up @@ -72,7 +74,7 @@ stdenv.mkDerivation rec {
# himself.
mkdir -p "$out/share/emacs/site-lisp"
cp "contrib/emacs/password-store.el" "$out/share/emacs/site-lisp/"
'' + optionalString x11Support ''
'' + optionalString dmenuSupport ''
cp "contrib/dmenu/passmenu" "$out/bin/"
'';

Expand All @@ -87,7 +89,8 @@ stdenv.mkDerivation rec {
qrencode
procps
] ++ optional stdenv.isDarwin openssl
++ ifEnable x11Support [ dmenu xclip xdotool ]
++ optional x11Support xclip
++ optionals dmenuSupport [ xdotool dmenu ]
++ optional waylandSupport wl-clipboard);

postFixup = ''
Expand All @@ -98,7 +101,7 @@ stdenv.mkDerivation rec {
# Ensure all dependencies are in PATH
wrapProgram $out/bin/pass \
--prefix PATH : "${wrapperPath}"
'' + stdenv.lib.optionalString x11Support ''
'' + stdenv.lib.optionalString dmenuSupport ''
# We just wrap passmenu with the same PATH as pass. It doesn't
# need all the tools in there but it doesn't hurt either.
wrapProgram $out/bin/passmenu \
Expand Down
5 changes: 5 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,11 @@ in

pass = callPackage ../tools/security/pass { };

pass-nodmenu = callPackage ../tools/security/pass {
dmenuSupport = false;
pass = pass-nodmenu;
};

pass-wayland = callPackage ../tools/security/pass {
waylandSupport = true;
pass = pass-wayland;
Expand Down

0 comments on commit 118695a

Please sign in to comment.