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; [
42 xcbutilwm # libxcb-icccm.so.4
43 xcbutilimage # libxcb-image.so.0
44 xcbutilkeysyms # libxcb-keysyms.so.1
45 xcbutilrenderutil # libxcb-render-util.so.0
49 package = stdenv.mkDerivation {
51 inherit (data) version;
55 inherit (data) sha256;
56 url = "${baseUrl}/${data.path}";
60 description = "A well known password manager";
61 homepage = "https://www.enpass.io/";
62 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
63 license = licenses.unfree;
64 platforms = [ "x86_64-linux" "i686-linux"];
65 maintainers = with maintainers; [ ewok dritter ];
68 nativeBuildInputs = [ makeWrapper ];
71 unpackPhase = "dpkg -X $src .";
74 cp -r opt/enpass/* $out/bin
78 -i s@/opt/enpass/Enpass@$out/bin/Enpass@ \
79 $out/share/applications/enpass.desktop
81 for i in $out/bin/{Enpass,importer_enpass}; do
82 patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $i
85 # lsof must be in PATH for proper operation
86 wrapProgram $out/bin/Enpass \
87 --set LD_LIBRARY_PATH "${libPath}" \
88 --prefix PATH : ${lsof}/bin \
89 --unset QML2_IMPORT_PATH \
90 --unset QT_PLUGIN_PATH
94 update = stdenv.mkDerivation {
95 name = "enpass-update-script";
96 SCRIPT =./update_script.py;
98 buildInputs = with python3Packages; [python requests pathlib2 six attrs ];
100 exec python $SCRIPT --target pkgs/tools/security/enpass/data.json --repo ${baseUrl}
105 in (package // {refresh = updater;})