Skip to content

Commit 19e6323

Browse files
danieldkJon
authored andcommitted
_1password-gui: init at 0.8.0
1 parent 3ceabbd commit 19e6323

2 files changed

Lines changed: 72 additions & 0 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{ stdenv
2+
, fetchurl
3+
, appimageTools
4+
, makeWrapper
5+
, electron
6+
, openssl
7+
}:
8+
9+
stdenv.mkDerivation rec {
10+
pname = "1password";
11+
version = "0.8.0";
12+
13+
src = fetchurl {
14+
url = "https://onepassword.s3.amazonaws.com/linux/appimage/${pname}-${version}.AppImage";
15+
sha256 = "1r26vyx724h3k6p340bg3lmcxwyvgxj2kqvwczq784583hpq3lq9";
16+
};
17+
18+
nativeBuildInputs = [ makeWrapper ];
19+
20+
appimageContents = appimageTools.extractType2 {
21+
name = "${pname}-${version}";
22+
inherit src;
23+
};
24+
25+
dontUnpack = true;
26+
dontConfigure = true;
27+
dontBuild = true;
28+
29+
installPhase = let
30+
runtimeLibs = [
31+
openssl.out
32+
stdenv.cc.cc
33+
];
34+
in ''
35+
mkdir -p $out/bin $out/share/1password
36+
37+
# Applications files.
38+
cp -a ${appimageContents}/{locales,resources} $out/share/${pname}
39+
40+
# Desktop file.
41+
install -Dt $out/share/applications ${appimageContents}/${pname}.desktop
42+
substituteInPlace $out/share/applications/${pname}.desktop \
43+
--replace 'Exec=AppRun' 'Exec=${pname}'
44+
45+
# Icons.
46+
cp -a ${appimageContents}/usr/share/icons $out/share
47+
48+
# Wrap the application with Electron.
49+
makeWrapper "${electron}/bin/electron" "$out/bin/${pname}" \
50+
--add-flags "$out/share/${pname}/resources/app.asar" \
51+
--prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath runtimeLibs}"
52+
'';
53+
54+
meta = with stdenv.lib; {
55+
description = "Multi-platform password manager";
56+
longDescription = ''
57+
1Password is a multi-platform package manager.
58+
59+
The Linux version is currently a development preview and can
60+
only be used to search, view, and copy items. However items
61+
cannot be created or edited.
62+
'';
63+
homepage = "https://1password.com/";
64+
license = licenses.unfree;
65+
maintainers = with maintainers; [ danieldk ];
66+
platforms = [ "x86_64-linux" ];
67+
};
68+
}

pkgs/top-level/all-packages.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,10 @@ in
536536

537537
_1password = callPackage ../applications/misc/1password { };
538538

539+
_1password-gui = callPackage ../tools/security/1password-gui {
540+
electron = electron_9;
541+
};
542+
539543
_6tunnel = callPackage ../tools/networking/6tunnel { };
540544

541545
_9pfs = callPackage ../tools/filesystems/9pfs { };

0 commit comments

Comments
 (0)