@ -1,6 +1,6 @@
{ stdenv , lib , pkgs , fetchurl , buildEnv
, coreutils , gnused , getopt , git , tree , gnupg , openssl , which , procps
, qrencode , makeWrapper
, qrencode , makeWrapper , pass , symlinkJoin
, xclip ? null , xdotool ? null , dmenu ? null
, x11Support ? ! stdenv . isDarwin
@ -23,131 +23,136 @@ let
env = extensions :
let
selected = extensions passExtensions
selected = [ pass ] ++ extensions passExtensions
++ stdenv . lib . optional tombPluginSupport passExtensions . tomb ;
in buildEnv {
name = " p a s s - e x t e n s i o n s - e n v " ;
paths = selected ;
buildInputs = concatMap ( x : x . buildInputs ) selected ;
} ;
generic = extensionsEnv : extraPassthru : stdenv . mkDerivation rec {
version = " 1 . 7 . 3 " ;
pname = " p a s s w o r d - s t o r e " ;
buildInputs = [ makeWrapper ] ++ concatMap ( x : x . buildInputs ) selected ;
src = fetchurl {
url = " h t t p s : / / g i t . z x 2 c 4 . c o m / p a s s w o r d - s t o r e / s n a p s h o t / ${ pname } - ${ version } . t a r . x z " ;
sha256 = " 1 x 5 3 k 5 d n 3 c d m v y 8 m 4 f q d l d 4 h j i 5 n 6 7 6 k s l 0 q l 4 a r m k m s d s 2 6 a v 1 b " ;
} ;
postBuild = ''
files = $ ( find $ out/bin / - type f - exec readlink - f { } \ ; )
rm $ out/bin
mkdir $ out/bin
patches = [ ./set-correct-program-name-for-sleep.patch ]
++ stdenv . lib . optional stdenv . isDarwin ./no-darwin-getopt.patch
# TODO (@Ma27) this patch adds support for wl-clipboard and can be removed during the next
# version bump.
++ stdenv . lib . optional waylandSupport ./clip-wayland-support.patch ;
for i in $ files ; do
ln - sf $ i $ out/bin / $ ( basename $ i )
done
nativeBuildInputs = [ makeWrapper ] ;
buildInputs = [ extensionsEnv ] ;
wrapProgram $ out/bin/pass \
- - set SYSTEM_EXTENSION_DIR " $ o u t / l i b / p a s s w o r d - s t o r e / e x t e n s i o n s "
'' ;
} ;
in
installFlags = [ " P R E F I X = $ ( o u t ) " " W I T H _ A L L C O M P = y e s " ] ;
stdenv . mkDerivation rec {
version = " 1 . 7 . 3 " ;
pname = " p a s s w o r d - s t o r e " ;
postInstall = ''
# Install Emacs Mode. NOTE: We can't install the necessary
# dependencies (s.el and f.el) here. The user has to do this
# himself.
mkdir - p " $ o u t / s h a r e / e m a c s / s i t e - l i s p "
cp " c o n t r i b / e m a c s / p a s s w o r d - s t o r e . e l " " $ o u t / s h a r e / e m a c s / s i t e - l i s p / "
'' + o p t i o n a l S t r i n g x 1 1 S u p p o r t ''
cp " c o n t r i b / d m e n u / p a s s m e n u " " $ o u t / b i n / "
'' ;
src = fetchurl {
url = " h t t p s : / / g i t . z x 2 c 4 . c o m / p a s s w o r d - s t o r e / s n a p s h o t / ${ pname } - ${ version } . t a r . x z " ;
sha256 = " 1 x 5 3 k 5 d n 3 c d m v y 8 m 4 f q d l d 4 h j i 5 n 6 7 6 k s l 0 q l 4 a r m k m s d s 2 6 a v 1 b " ;
} ;
wrapperPath = with stdenv . lib ; makeBinPath ( [
coreutils
getopt
git
gnupg
gnused
tree
which
qrencode
procps
] ++ optional stdenv . isDarwin openssl
++ ifEnable x11Support [ dmenu xclip xdotool ]
++ optional waylandSupport wl-clipboard ) ;
postFixup = ''
# Link extensions env
rmdir $ out/lib/password-store/extensions
ln - s $ { extensionsEnv } /lib/password-store/extensions $ out/lib/password-store/.
for f in $ { extensionsEnv } /share/man/man1 /* . 1 . g z ; d o
ln - s $ f $ out/share/man/man1 /
done
# Fix program name in --help
substituteInPlace $ out/bin/pass \
- - replace ' PROGRAM = " ' ' ${ 0 ##*/}"' "PROGRAM=pass"
# Ensure all dependencies are in PATH
wrapProgram $ out/bin/pass \
- - prefix PATH : " ${ wrapperPath } "
'' + s t d e n v . l i b . o p t i o n a l S t r i n g x 1 1 S u p p o r t ''
# 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 \
- - prefix PATH : " $ o u t / b i n : ${ wrapperPath } "
'' ;
patches = [
./set-correct-program-name-for-sleep.patch
./extension-dir.patch
] ++ stdenv . lib . optional stdenv . isDarwin ./no-darwin-getopt.patch
# TODO (@Ma27) this patch adds support for wl-clipboard and can be removed during the next
# version bump.
++ stdenv . lib . optional waylandSupport ./clip-wayland-support.patch ;
nativeBuildInputs = [ makeWrapper ] ;
installFlags = [ " P R E F I X = $ ( o u t ) " " W I T H _ A L L C O M P = y e s " ] ;
postInstall = ''
# Install Emacs Mode. NOTE: We can't install the necessary
# dependencies (s.el and f.el) here. The user has to do this
# himself.
mkdir - p " $ o u t / s h a r e / e m a c s / s i t e - l i s p "
cp " c o n t r i b / e m a c s / p a s s w o r d - s t o r e . e l " " $ o u t / s h a r e / e m a c s / s i t e - l i s p / "
'' + o p t i o n a l S t r i n g x 1 1 S u p p o r t ''
cp " c o n t r i b / d m e n u / p a s s m e n u " " $ o u t / b i n / "
'' ;
wrapperPath = with stdenv . lib ; makeBinPath ( [
coreutils
getopt
git
gnupg
gnused
tree
which
qrencode
procps
] ++ optional stdenv . isDarwin openssl
++ ifEnable x11Support [ dmenu xclip xdotool ]
++ optional waylandSupport wl-clipboard ) ;
postFixup = ''
# Fix program name in --help
substituteInPlace $ out/bin/pass \
- - replace ' PROGRAM = " ' ' ${ 0 ##*/}"' "PROGRAM=pass"
# Ensure all dependencies are in PATH
wrapProgram $ out/bin/pass \
- - prefix PATH : " ${ wrapperPath } "
'' + s t d e n v . l i b . o p t i o n a l S t r i n g x 1 1 S u p p o r t ''
# 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 \
- - prefix PATH : " $ o u t / b i n : ${ wrapperPath } "
'' ;
# Turn "check" into "installcheck", since we want to test our pass,
# not the one before the fixup.
postPatch = ''
patchShebangs tests
substituteInPlace src/password-store.sh \
- - replace " @ o u t @ " " $ o u t "
# the turning
sed - i - e ' s @ ^ PASS = . * '' $@ P A S S = $o u t / b i n / p a s s @ ' \
- e ' s @ ^ GPGS = . * '' $@ G P G = ${ gnupg } / b i n / g p g 2 @ ' \
- e ' /which gpg / d' \
tests/setup.sh
'' + s t d e n v . l i b . o p t i o n a l S t r i n g s t d e n v . i s D a r w i n ''
# 'pass edit' uses hdid, which is not available from the sandbox.
rm - f tests/t0200-edit-tests.sh
rm - f tests/t0010-generate-tests.sh
rm - f tests/t0020-show-tests.sh
rm - f tests/t0050-mv-tests.sh
rm - f tests/t0100-insert-tests.sh
rm - f tests/t0300-reencryption.sh
rm - f tests/t0400-grep.sh
'' ;
doCheck = false ;
doInstallCheck = true ;
installCheckInputs = [ git ] ;
installCheckTarget = " t e s t " ;
passthru = {
extensions = passExtensions ;
withExtensions = env ;
} ;
# Turn "check" into "installcheck", since we want to test our pass,
# not the one before the fixup.
postPatch = ''
patchShebangs tests
# the turning
sed - i - e ' s @ ^ PASS = . * '' $@ P A S S = $o u t / b i n / p a s s @ ' \
- e ' s @ ^ GPGS = . * '' $@ G P G = ${ gnupg } / b i n / g p g 2 @ ' \
- e ' /which gpg / d' \
tests/setup.sh
'' + s t d e n v . l i b . o p t i o n a l S t r i n g s t d e n v . i s D a r w i n ''
# 'pass edit' uses hdid, which is not available from the sandbox.
rm - f tests/t0200-edit-tests.sh
rm - f tests/t0010-generate-tests.sh
rm - f tests/t0020-show-tests.sh
rm - f tests/t0050-mv-tests.sh
rm - f tests/t0100-insert-tests.sh
rm - f tests/t0300-reencryption.sh
rm - f tests/t0400-grep.sh
meta = with stdenv . lib ; {
description = " S t o r e s , r e t r i e v e s , g e n e r a t e s , a n d s y n c h r o n i z e s p a s s w o r d s s e c u r e l y " ;
homepage = https://www.passwordstore.org/ ;
license = licenses . gpl2Plus ;
maintainers = with maintainers ; [ lovek323 the-kenny fpletz tadfisher globin ma27 ] ;
platforms = platforms . unix ;
longDescription = ''
pass is a very simple password store that keeps passwords inside gpg2
encrypted files inside a simple directory tree residing at
~/.password-store. The pass utility provides a series of commands for
manipulating the password store , allowing the user to add , remove , edit ,
synchronize , generate , and manipulate passwords .
'' ;
doCheck = false ;
doInstallCheck = true ;
installCheckInputs = [ git ] ;
installCheckTarget = " t e s t " ;
passthru = {
extensions = passExtensions ;
} // extraPassthru ;
meta = with stdenv . lib ; {
description = " S t o r e s , r e t r i e v e s , g e n e r a t e s , a n d s y n c h r o n i z e s p a s s w o r d s s e c u r e l y " ;
homepage = https://www.passwordstore.org/ ;
license = licenses . gpl2Plus ;
maintainers = with maintainers ; [ lovek323 the-kenny fpletz tadfisher globin ] ;
platforms = platforms . unix ;
longDescription = ''
pass is a very simple password store that keeps passwords inside gpg2
encrypted files inside a simple directory tree residing at
~/.password-store. The pass utility provides a series of commands for
manipulating the password store , allowing the user to add , remove , edit ,
synchronize , generate , and manipulate passwords .
'' ;
} ;
} ;
in
generic ( env ( _ : [ ] ) ) {
withExtensions = extensions : generic ( env extensions ) { } ;
}