1 { stdenv, fetchurl, dpkg, xorg
2 , glib, libGLU, libGL, libpulseaudio, zlib, dbus, fontconfig, freetype
4 , makeWrapper , python3Packages, lib, libcap
5 , lsof, curl, libuuid, cups, mesa, xz, libxkbcommon
9 all_data = lib.importJSON ./data.json;
11 # i686-linux = "i386"; Uncomment if enpass 6 becomes available on i386
12 x86_64-linux = "amd64";
15 data = all_data.${system_map.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}")};
17 baseUrl = "https://apt.enpass.io";
19 # used of both wrappers and libpath
20 libPath = lib.makeLibraryPath (with xorg; [
41 xcbutilwm # libxcb-icccm.so.4
42 xcbutilimage # libxcb-image.so.0
43 xcbutilkeysyms # libxcb-keysyms.so.1
44 xcbutilrenderutil # libxcb-render-util.so.0
48 package = stdenv.mkDerivation {
50 inherit (data) version;
54 inherit (data) sha256;
55 url = "${baseUrl}/${data.path}";
59 description = "Well known password manager";
60 homepage = "https://www.enpass.io/";
61 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
62 license = licenses.unfree;
63 platforms = [ "x86_64-linux" "i686-linux"];
64 maintainers = with maintainers; [ ewok dritter ];
67 nativeBuildInputs = [ makeWrapper ];
70 unpackPhase = "dpkg -X $src .";
73 cp -r opt/enpass/* $out/bin
77 -i s@/opt/enpass/Enpass@$out/bin/Enpass@ \
78 $out/share/applications/enpass.desktop
80 for i in $out/bin/{Enpass,importer_enpass}; do
81 patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $i
84 # lsof must be in PATH for proper operation
85 wrapProgram $out/bin/Enpass \
86 --set LD_LIBRARY_PATH "${libPath}" \
87 --prefix PATH : ${lsof}/bin \
88 --unset QML2_IMPORT_PATH \
89 --unset QT_PLUGIN_PATH
93 update = stdenv.mkDerivation {
94 name = "enpass-update-script";
95 SCRIPT =./update_script.py;
97 buildInputs = with python3Packages; [python requests pathlib2 six attrs ];
99 exec python $SCRIPT --target pkgs/tools/security/enpass/data.json --repo ${baseUrl}
104 in (package // {refresh = updater;})