nixpkgs/pkgs/applications/misc/1password-gui/default.nix

71 lines
1.8 KiB
Nix
Raw Normal View History

{ lib, stdenv
2020-08-08 08:06:45 +01:00
, fetchurl
, appimageTools
, makeWrapper
2020-12-01 15:24:19 +00:00
, electron_11
2020-08-08 08:06:45 +01:00
, openssl
}:
stdenv.mkDerivation rec {
pname = "1password";
2021-03-17 21:40:02 +00:00
version = "8.0.28";
2020-08-08 08:06:45 +01:00
src = fetchurl {
url = "https://onepassword.s3.amazonaws.com/linux/appimage/${pname}-${version}.AppImage";
2021-03-17 21:40:02 +00:00
hash = "sha256-okLeyok/5rihGXaQaUR06dGkpuqqW02qJ6q6VVLtZsE=";
2020-08-08 08:06:45 +01: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.
2020-12-01 15:24:19 +00:00
makeWrapper "${electron_11}/bin/electron" "$out/bin/${pname}" \
2020-08-08 08:06:45 +01:00
--add-flags "$out/share/${pname}/resources/app.asar" \
2021-01-15 09:19:50 +00:00
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeLibs}"
2020-08-08 08:06:45 +01:00
'';
2020-08-25 19:25:23 +01:00
passthru.updateScript = ./update.sh;
meta = with lib; {
2020-08-08 08:06:45 +01: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;
maintainers = with maintainers; [ danieldk timstott ];
2020-08-08 08:06:45 +01:00
platforms = [ "x86_64-linux" ];
};
}