@ -2,76 +2,112 @@
, stdenv
, fetchurl
, makeWrapper
, electron_11
, openssl
, alsaLib
, at-spi2-atk
, at-spi2-core
, atk
, cairo
, cups
, dbus
, expat
, gdk-pixbuf
, glib
, gtk3
, libX11
, libXcomposite
, libXdamage
, libXext
, libXfixes
, libXrandr
, libdrm
, libxcb
, libxkbcommon
, libxshmfence
, mesa
, nspr
, nss
, pango
, systemd
, xdg-utils
} :
stdenv . mkDerivation rec {
pname = " 1 p a s s w o r d " ;
version = " 8 . 0 . 3 3 - 5 3 . B E T A " ;
version = " 8 . 0 . 3 4 " ;
src = fetchurl {
url = " h t t p s : / / d o w n l o a d s . 1 p a s s w o r d . c o m / l i n u x / t a r / b e t a / x 8 6 _ 6 4 / 1 p a s s w o r d - ${ version } . x 6 4 . t a r . g z " ;
hash = " s h a 2 5 6 - Y U Y E R + U i M 1 Q E D g G l 0 P 9 b I T 6 5 Y V a c U n u G t Q V k V 9 1 t e E U = " ;
url = " h t t p s : / / d o w n l o a d s . 1 p a s s w o r d . c o m / l i n u x / t a r / s t a b l e / x 8 6 _ 6 4 / 1 p a s s w o r d - ${ version } . x 6 4 . t a r . g z " ;
sha256 = " 0 m p 1 1 9 v 5 v g s v a 7 p n x p s b q 4 x h h 4 v b h w v 7 g a 9 b 5 b 7 f 6 s l x 3 b i y 1 w m h " ;
} ;
nativeBuildInputs = [ makeWrapper ] ;
dontConfigure = true ;
dontBuild = true ;
dontPatchELF = true ;
installPhase = let
runtimeLibs = [
openssl . out
stdenv . cc . cc
] ;
in ''
mkdir - p $ out/bin $ out/share/1password
# Applications files.
cp - a { locales , resources } $ out/share / $ { pname }
install - Dm0755 - t $ out/share / $ { pname } { 1 Password-BrowserSupport , 1 Password-KeyringHelper }
installPhase =
let rpath = lib . makeLibraryPath [
alsaLib
at-spi2-atk
at-spi2-core
atk
cairo
cups
dbus
expat
gdk-pixbuf
glib
gtk3
libX11
libXcomposite
libXdamage
libXext
libXfixes
libXrandr
libdrm
libxcb
libxkbcommon
libxshmfence
mesa
nspr
nss
pango
systemd
] + " : ${ stdenv . cc . cc . lib } / l i b 6 4 " ;
in ''
runHook preInstall
# Desktop file.
install - Dt $ out/share/applications resources / $ { pname } . desktop
substituteInPlace $ out/share/applications / $ { pname } . desktop \
- - replace ' Exec = /opt/1Password / $ { pname } ' ' Exec = $ { pname } '
mkdir - p $ out/bin $ out/share/1password
cp - a * $ out/share/1password
# Icons.
cp - a resources/icons $ out/share
# Desktop file
install - Dt $ out/share/applications resources / $ { pname } . desktop
substituteInPlace $ out/share/applications / $ { pname } . desktop \
- - replace ' Exec = /opt/1Password / $ { pname } ' ' Exec = $ { pname } '
# Wrap the application with Electron.
makeWrapper " ${ electron_11 } / b i n / e l e c t r o n " " $ o u t / b i n / ${ pname } " \
- - add-flags " $ o u t / s h a r e / ${ pname } / r e s o u r c e s / a p p . a s a r " \
- - prefix LD_LIBRARY_PATH : " ${ lib . makeLibraryPath runtimeLibs } "
# Icons
cp - a resources/icons $ out/share
# Set the interpreter for the helper binaries and wrap them with
# the runtime libraries.
interp = " $ ( c a t $ N I X _ C C / n i x - s u p p o r t / d y n a m i c - l i n k e r ) "
patchelf - - set-interpreter $ interp \
$ out/share / $ pname / { 1 Password-BrowserSupport , 1 Password-KeyringHelper }
interp = " $ ( c a t $ N I X _ C C / n i x - s u p p o r t / d y n a m i c - l i n k e r ) "
patchelf - - set-interpreter $ interp $ out/share/1password / { 1 password , 1 Password-BrowserSupport , 1 Password-KeyringHelper }
patchelf - - set-rpath $ { rpath }: $ out/share/1password $ out/share/1password / { 1 password , 1 Password-BrowserSupport , 1 Password-KeyringHelper }
for file in $ ( find $ out - type f - name \ * . so \ * ) ; do
patchelf - - set-rpath $ { rpath }: $ out/share/1password $ file
done
wrapProgram $ out/share / $ { pname } /1Password-BrowserSupport \
- - prefix LD_LIBRARY_ PATH : " ${ lib . makeLibraryPath runtimeLibs } "
makeWrapper $ out/share/1password/1password $ out/bin/1password \
- - prefix PATH : $ { xdg-utils } /bin
wrapProgram $ out/share / $ { pname } /1Password-KeyringHelper \
- - prefix LD_LIBRARY_PATH : " ${ lib . makeLibraryPath runtimeLibs } "
'' ;
runHook postInstall
'' ;
passthru . updateScript = ./update.sh ;
meta = with lib ; {
description = " M u l t i - p l a t f o r m p a s s w o r d m a n a g e r " ;
longDescription = ''
1 Password is a multi-platform package manager .
The Linux version is currently a development preview and can
only be used to search , view , and copy items . However items
cannot be created or edited .
'' ;
homepage = " h t t p s : / / 1 p a s s w o r d . c o m / " ;
license = licenses . unfree ;
maintainers = with maintainers ; [ danieldk timstott ] ;
maintainers = with maintainers ; [ danieldk timstott savannidgerinel ] ;
platforms = [ " x 8 6 _ 6 4 - l i n u x " ] ;
} ;
}