pass: rename withX into x11Support, cleanup a bit

This commit is contained in:
Jan Malakhovski 2015-03-21 12:57:01 +00:00
parent 6b9bb72319
commit 1ddc9e4be3

View File

@ -1,12 +1,14 @@
{ stdenv, fetchurl { stdenv, fetchurl
, coreutils, gnused, getopt, pwgen, git, tree, gnupg , coreutils, gnused, getopt, pwgen, git, tree, gnupg
, makeWrapper , makeWrapper
, withX ? true, xclip, xdotool, dmenu
, xclip ? null, xdotool ? null, dmenu ? null
, x11Support ? true
}: }:
assert withX -> xclip != null; assert x11Support -> xclip != null
assert withX -> xdotool != null; && xdotool != null
assert withX -> dmenu != null; && dmenu != null;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "1.6.5"; version = "1.6.5";
@ -52,7 +54,7 @@ stdenv.mkDerivation rec {
mkdir -p "$out/share/emacs/site-lisp" mkdir -p "$out/share/emacs/site-lisp"
cp "contrib/emacs/password-store.el" "$out/share/emacs/site-lisp/" cp "contrib/emacs/password-store.el" "$out/share/emacs/site-lisp/"
${if withX then '' ${if x11Support then ''
cp "contrib/dmenu/passmenu" "$out/bin/" cp "contrib/dmenu/passmenu" "$out/bin/"
'' else ""} '' else ""}
''; '';
@ -64,9 +66,9 @@ stdenv.mkDerivation rec {
# Ensure all dependencies are in PATH # Ensure all dependencies are in PATH
wrapProgram $out/bin/pass \ wrapProgram $out/bin/pass \
--prefix PATH : "${coreutils}/bin:${gnused}/bin:${getopt}/bin:${gnupg}/bin:${git}/bin:${tree}/bin:${pwgen}/bin${if withX then ":${xclip}/bin" else ""}" --prefix PATH : "${coreutils}/bin:${gnused}/bin:${getopt}/bin:${gnupg}/bin:${git}/bin:${tree}/bin:${pwgen}/bin${if x11Support then ":${xclip}/bin" else ""}"
${if withX then '' ${if x11Support then ''
wrapProgram $out/bin/passmenu \ wrapProgram $out/bin/passmenu \
--prefix PATH : "$out/bin:${xdotool}/bin:${dmenu}/bin" --prefix PATH : "$out/bin:${xdotool}/bin:${dmenu}/bin"
'' else ""} '' else ""}