From 19e6323478ee6123860c9dd19b8ee8ef3ad92d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Sat, 8 Aug 2020 09:06:45 +0200 Subject: [PATCH] _1password-gui: init at 0.8.0 --- pkgs/tools/security/1password-gui/default.nix | 68 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 2 files changed, 72 insertions(+) create mode 100644 pkgs/tools/security/1password-gui/default.nix diff --git a/pkgs/tools/security/1password-gui/default.nix b/pkgs/tools/security/1password-gui/default.nix new file mode 100644 index 000000000000..3fc19c12e8e8 --- /dev/null +++ b/pkgs/tools/security/1password-gui/default.nix @@ -0,0 +1,68 @@ +{ stdenv +, fetchurl +, appimageTools +, makeWrapper +, electron +, openssl +}: + +stdenv.mkDerivation rec { + pname = "1password"; + version = "0.8.0"; + + src = fetchurl { + url = "https://onepassword.s3.amazonaws.com/linux/appimage/${pname}-${version}.AppImage"; + sha256 = "1r26vyx724h3k6p340bg3lmcxwyvgxj2kqvwczq784583hpq3lq9"; + }; + + 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}" + ''; + + 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; + maintainers = with maintainers; [ danieldk ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f6a45abf7660..bdffee7a7564 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -536,6 +536,10 @@ in _1password = callPackage ../applications/misc/1password { }; + _1password-gui = callPackage ../tools/security/1password-gui { + electron = electron_9; + }; + _6tunnel = callPackage ../tools/networking/6tunnel { }; _9pfs = callPackage ../tools/filesystems/9pfs { };