2021-05-04 21:07:42 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-08-20 17:08:02 +00:00
|
|
|
, fetchurl
|
|
|
|
, makeWrapper
|
2021-06-28 23:13:55 +00:00
|
|
|
, alsa-lib
|
2021-05-28 09:39:13 +00:00
|
|
|
, 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
|
2021-07-17 21:14:59 +00:00
|
|
|
, udev
|
2021-05-28 09:39:13 +00:00
|
|
|
, xdg-utils
|
2020-08-20 17:08:02 +00:00
|
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "1password";
|
2021-10-17 02:12:59 +00:00
|
|
|
version = "8.3.0";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-05-28 09:39:13 +00:00
|
|
|
url = "https://downloads.1password.com/linux/tar/stable/x86_64/1password-${version}.x64.tar.gz";
|
2021-10-17 02:12:59 +00:00
|
|
|
sha256 = "1cakv316ipwyw6s3x4a6qhl0nmg17bxhh08c969gma3svamh1grw";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
2021-05-28 09:39:13 +00:00
|
|
|
dontPatchELF = true;
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
installPhase =
|
|
|
|
let rpath = lib.makeLibraryPath [
|
2021-06-28 23:13:55 +00:00
|
|
|
alsa-lib
|
2021-05-28 09:39:13 +00:00
|
|
|
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}/lib64";
|
|
|
|
in ''
|
|
|
|
runHook preInstall
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
mkdir -p $out/bin $out/share/1password
|
|
|
|
cp -a * $out/share/1password
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
# Desktop file
|
|
|
|
install -Dt $out/share/applications resources/${pname}.desktop
|
|
|
|
substituteInPlace $out/share/applications/${pname}.desktop \
|
|
|
|
--replace 'Exec=/opt/1Password/${pname}' 'Exec=${pname}'
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-09-22 15:38:15 +00:00
|
|
|
# Polkit file
|
|
|
|
install -Dm 0644 -t $out/share/polkit-1/actions com.1password.1Password.policy
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
# Icons
|
|
|
|
cp -a resources/icons $out/share
|
2021-05-04 21:07:42 +00:00
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
interp="$(cat $NIX_CC/nix-support/dynamic-linker)"
|
|
|
|
patchelf --set-interpreter $interp $out/share/1password/{1password,1Password-BrowserSupport,1Password-KeyringHelper}
|
|
|
|
patchelf --set-rpath ${rpath}:$out/share/1password $out/share/1password/{1password,1Password-BrowserSupport,1Password-KeyringHelper}
|
|
|
|
for file in $(find $out -type f -name \*.so\* ); do
|
|
|
|
patchelf --set-rpath ${rpath}:$out/share/1password $file
|
|
|
|
done
|
2021-05-04 21:07:42 +00:00
|
|
|
|
2021-07-17 21:14:59 +00:00
|
|
|
# Electron is trying to open udev via dlopen()
|
|
|
|
# and for some reason that doesn't seem to be impacted from the rpath.
|
|
|
|
# Adding udev to LD_LIBRARY_PATH fixes that.
|
2021-05-28 09:39:13 +00:00
|
|
|
makeWrapper $out/share/1password/1password $out/bin/1password \
|
2021-07-17 21:14:59 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ xdg-utils ]} \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ udev ]}
|
2021-05-04 21:07:42 +00:00
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-08-20 17:08:02 +00:00
|
|
|
description = "Multi-platform password manager";
|
|
|
|
homepage = "https://1password.com/";
|
|
|
|
license = licenses.unfree;
|
2021-07-04 02:40:35 +00:00
|
|
|
maintainers = with maintainers; [ timstott savannidgerinel ];
|
2020-08-20 17:08:02 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|