2021-03-28 10:40:34 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-08-08 09:06:45 +02:00
|
|
|
, fetchurl
|
|
|
|
, makeWrapper
|
2020-12-01 16:24:19 +01:00
|
|
|
, electron_11
|
2020-08-08 09:06:45 +02:00
|
|
|
, openssl
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "1password";
|
2021-05-01 11:11:43 +02:00
|
|
|
version = "8.0.33-53.BETA";
|
2020-08-08 09:06:45 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-05-01 11:11:43 +02:00
|
|
|
url = "https://downloads.1password.com/linux/tar/beta/x86_64/1password-${version}.x64.tar.gz";
|
|
|
|
hash = "sha256-YUYER+UiM1QEDgGl0P9bIT65YVacUnuGtQVkV91teEU=";
|
2020-08-08 09:06:45 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = let
|
|
|
|
runtimeLibs = [
|
|
|
|
openssl.out
|
|
|
|
stdenv.cc.cc
|
|
|
|
];
|
|
|
|
in ''
|
|
|
|
mkdir -p $out/bin $out/share/1password
|
|
|
|
|
|
|
|
# Applications files.
|
2021-03-28 10:40:34 +02:00
|
|
|
cp -a {locales,resources} $out/share/${pname}
|
|
|
|
install -Dm0755 -t $out/share/${pname} {1Password-BrowserSupport,1Password-KeyringHelper}
|
2020-08-08 09:06:45 +02:00
|
|
|
|
|
|
|
# Desktop file.
|
2021-05-01 11:11:43 +02:00
|
|
|
install -Dt $out/share/applications resources/${pname}.desktop
|
2020-08-08 09:06:45 +02:00
|
|
|
substituteInPlace $out/share/applications/${pname}.desktop \
|
2021-03-28 10:40:34 +02:00
|
|
|
--replace 'Exec=/opt/1Password/${pname}' 'Exec=${pname}'
|
2020-08-08 09:06:45 +02:00
|
|
|
|
|
|
|
# Icons.
|
2021-05-01 11:11:43 +02:00
|
|
|
cp -a resources/icons $out/share
|
2020-08-08 09:06:45 +02:00
|
|
|
|
|
|
|
# Wrap the application with Electron.
|
2020-12-01 16:24:19 +01:00
|
|
|
makeWrapper "${electron_11}/bin/electron" "$out/bin/${pname}" \
|
2020-08-08 09:06:45 +02:00
|
|
|
--add-flags "$out/share/${pname}/resources/app.asar" \
|
2021-01-15 10:19:50 +01:00
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeLibs}"
|
2021-03-28 10:40:34 +02:00
|
|
|
|
|
|
|
# Set the interpreter for the helper binaries and wrap them with
|
|
|
|
# the runtime libraries.
|
|
|
|
interp="$(cat $NIX_CC/nix-support/dynamic-linker)"
|
|
|
|
patchelf --set-interpreter $interp \
|
|
|
|
$out/share/$pname/{1Password-BrowserSupport,1Password-KeyringHelper}
|
|
|
|
|
|
|
|
wrapProgram $out/share/${pname}/1Password-BrowserSupport \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeLibs}"
|
|
|
|
|
|
|
|
wrapProgram $out/share/${pname}/1Password-KeyringHelper \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeLibs}"
|
2020-08-08 09:06:45 +02:00
|
|
|
'';
|
|
|
|
|
2020-08-25 20:25:23 +02:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-08-08 09:06:45 +02:00
|
|
|
description = "Multi-platform password manager";
|
|
|
|
longDescription = ''
|
|
|
|
1Password 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 = "https://1password.com/";
|
|
|
|
license = licenses.unfree;
|
2020-10-27 09:49:45 +01:00
|
|
|
maintainers = with maintainers; [ danieldk timstott ];
|
2020-08-08 09:06:45 +02:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|