2020-08-20 17:08:02 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, appimageTools
|
|
|
|
, makeWrapper
|
2020-09-25 04:45:31 +00:00
|
|
|
, electron_9
|
2020-08-20 17:08:02 +00:00
|
|
|
, openssl
|
|
|
|
}:
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
let
|
|
|
|
electron = electron_9;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "1password";
|
2020-11-03 02:18:15 +00:00
|
|
|
version = "0.9.1";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://onepassword.s3.amazonaws.com/linux/appimage/${pname}-${version}.AppImage";
|
2020-11-03 02:18:15 +00:00
|
|
|
sha256 = "04hv7hw4s3f65kf3ggh9l0nrx25k5yj2kqv83nl7pvam5lvnv8sz";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
appimageContents = appimageTools.extractType2 {
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
inherit src;
|
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = let
|
|
|
|
runtimeLibs = [
|
|
|
|
openssl.out
|
|
|
|
stdenv.cc.cc
|
|
|
|
];
|
|
|
|
in ''
|
|
|
|
mkdir -p $out/bin $out/share/1password
|
|
|
|
|
|
|
|
# Applications files.
|
|
|
|
cp -a ${appimageContents}/{locales,resources} $out/share/${pname}
|
|
|
|
|
|
|
|
# Desktop file.
|
|
|
|
install -Dt $out/share/applications ${appimageContents}/${pname}.desktop
|
|
|
|
substituteInPlace $out/share/applications/${pname}.desktop \
|
|
|
|
--replace 'Exec=AppRun' 'Exec=${pname}'
|
|
|
|
|
|
|
|
# Icons.
|
|
|
|
cp -a ${appimageContents}/usr/share/icons $out/share
|
|
|
|
|
|
|
|
# Wrap the application with Electron.
|
|
|
|
makeWrapper "${electron}/bin/electron" "$out/bin/${pname}" \
|
|
|
|
--add-flags "$out/share/${pname}/resources/app.asar" \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath runtimeLibs}"
|
|
|
|
'';
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
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-11-03 02:18:15 +00:00
|
|
|
maintainers = with maintainers; [ danieldk timstott ];
|
2020-08-20 17:08:02 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|