2019-01-11 21:32:00 +00:00
|
|
|
{ stdenv, fetchurl, dpkg, xorg
|
2019-11-10 16:44:34 +00:00
|
|
|
, glib, libGLU, libGL, libpulseaudio, zlib, dbus, fontconfig, freetype
|
2019-01-11 21:32:00 +00:00
|
|
|
, gtk3, pango
|
2019-11-13 15:18:05 +00:00
|
|
|
, makeWrapper , python2Packages, lib
|
2020-12-11 22:29:48 +00:00
|
|
|
, lsof, curl, libuuid, cups, mesa, lzma, libxkbcommon
|
2018-08-20 20:11:29 +01:00
|
|
|
}:
|
2018-05-03 06:58:11 +01:00
|
|
|
|
2016-09-19 17:50:52 +01:00
|
|
|
let
|
2018-05-03 06:58:11 +01:00
|
|
|
all_data = builtins.fromJSON (builtins.readFile ./data.json);
|
2016-09-19 17:50:52 +01:00
|
|
|
system_map = {
|
2019-01-11 21:32:00 +00:00
|
|
|
# i686-linux = "i386"; Uncomment if enpass 6 becomes available on i386
|
2016-09-19 17:50:52 +01:00
|
|
|
x86_64-linux = "amd64";
|
|
|
|
};
|
|
|
|
|
2018-08-20 20:11:29 +01:00
|
|
|
data = all_data.${system_map.${stdenv.hostPlatform.system} or (throw "Unsupported platform")};
|
2016-09-19 17:50:52 +01:00
|
|
|
|
2020-04-01 02:11:51 +01:00
|
|
|
baseUrl = "http://repo.sinew.in";
|
2016-12-04 16:25:35 +00:00
|
|
|
|
2016-09-19 17:50:52 +01:00
|
|
|
# used of both wrappers and libpath
|
|
|
|
libPath = lib.makeLibraryPath (with xorg; [
|
2019-05-28 20:09:34 +01:00
|
|
|
mesa.drivers
|
2019-11-10 16:44:34 +00:00
|
|
|
libGLU libGL
|
2016-09-19 17:50:52 +01:00
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
libpulseaudio
|
|
|
|
zlib
|
|
|
|
dbus
|
|
|
|
libX11
|
|
|
|
libXi
|
|
|
|
libSM
|
|
|
|
libICE
|
|
|
|
libXrender
|
|
|
|
libXScrnSaver
|
2019-01-11 21:32:00 +00:00
|
|
|
libxcb
|
2016-09-19 17:50:52 +01:00
|
|
|
glib
|
2019-01-11 21:32:00 +00:00
|
|
|
gtk3
|
2016-09-19 17:50:52 +01:00
|
|
|
pango
|
2019-01-11 21:32:00 +00:00
|
|
|
curl
|
|
|
|
libuuid
|
|
|
|
cups
|
2020-12-11 22:29:48 +00:00
|
|
|
lzma
|
|
|
|
libxkbcommon
|
2016-09-19 17:50:52 +01:00
|
|
|
]);
|
2019-08-13 22:52:01 +01:00
|
|
|
package = stdenv.mkDerivation {
|
2016-09-19 17:50:52 +01:00
|
|
|
|
|
|
|
inherit (data) version;
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "enpass";
|
2016-09-19 17:50:52 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
inherit (data) sha256;
|
|
|
|
url = "${baseUrl}/${data.path}";
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-12-11 22:29:48 +00:00
|
|
|
description = "A well known password manager";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.enpass.io/";
|
2020-12-11 22:29:48 +00:00
|
|
|
license = licenses.unfree;
|
2018-05-03 06:58:11 +01:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux"];
|
2020-12-21 08:18:40 +00:00
|
|
|
maintainers = with maintainers; [ ewok ];
|
2016-09-19 17:50:52 +01:00
|
|
|
};
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [dpkg];
|
2016-09-19 17:50:52 +01:00
|
|
|
phases = [ "unpackPhase" "installPhase" ];
|
|
|
|
|
|
|
|
unpackPhase = "dpkg -X $src .";
|
|
|
|
installPhase=''
|
2019-01-11 21:32:00 +00:00
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -r opt/enpass/* $out/bin
|
2016-12-27 13:23:16 +00:00
|
|
|
cp -r usr/* $out
|
2016-09-19 17:50:52 +01:00
|
|
|
|
2016-12-27 13:23:16 +00:00
|
|
|
sed \
|
2019-01-11 21:32:00 +00:00
|
|
|
-i s@/opt/enpass/Enpass@$out/bin/Enpass@ \
|
2018-05-03 06:58:11 +01:00
|
|
|
$out/share/applications/enpass.desktop
|
2016-09-19 17:50:52 +01:00
|
|
|
|
2019-01-11 21:32:00 +00:00
|
|
|
for i in $out/bin/{Enpass,importer_enpass}; do
|
2016-12-04 16:25:35 +00:00
|
|
|
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $i
|
|
|
|
done
|
2016-09-19 17:50:52 +01:00
|
|
|
|
2019-01-11 21:32:00 +00:00
|
|
|
# lsof must be in PATH for proper operation
|
2016-09-19 17:50:52 +01:00
|
|
|
wrapProgram $out/bin/Enpass \
|
2019-01-11 21:32:00 +00:00
|
|
|
--set LD_LIBRARY_PATH "${libPath}" \
|
2021-01-07 20:03:28 +00:00
|
|
|
--prefix PATH : ${lsof}/bin \
|
|
|
|
--unset QML2_IMPORT_PATH \
|
|
|
|
--unset QT_PLUGIN_PATH
|
2016-09-19 17:50:52 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
updater = {
|
2019-08-13 22:52:01 +01:00
|
|
|
update = stdenv.mkDerivation {
|
2016-09-19 17:50:52 +01:00
|
|
|
name = "enpass-update-script";
|
|
|
|
SCRIPT =./update_script.py;
|
2016-12-04 16:25:35 +00:00
|
|
|
|
2019-11-13 15:18:05 +00:00
|
|
|
buildInputs = with python2Packages; [python requests pathlib2 six attrs ];
|
2016-09-19 17:50:52 +01:00
|
|
|
shellHook = ''
|
2019-11-13 15:18:05 +00:00
|
|
|
exec python $SCRIPT --target pkgs/tools/security/enpass/data.json --repo ${baseUrl}
|
2016-09-19 17:50:52 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
2016-12-04 16:25:35 +00:00
|
|
|
in (package // {refresh = updater;})
|