diff --git a/pkgs/tools/security/keybase-gui/default.nix b/pkgs/tools/security/keybase-gui/default.nix new file mode 100644 index 000000000000..b1d8181da65b --- /dev/null +++ b/pkgs/tools/security/keybase-gui/default.nix @@ -0,0 +1,91 @@ +{ stdenv, fetchurl, buildFHSUserEnv, writeTextFile, alsaLib, atk, cairo, cups +, dbus, expat, fontconfig, freetype, gcc, gdk_pixbuf, glib, gnome2, gtk2, nspr +, nss, pango, systemd, xorg, utillinuxMinimal }: + +let + libPath = stdenv.lib.makeLibraryPath [ + alsaLib + atk + cairo + cups + dbus + expat + fontconfig + freetype + gcc.cc + gdk_pixbuf + glib + gnome2.GConf + gtk2 + nspr + nss + pango + systemd + xorg.libX11 + xorg.libXScrnSaver + xorg.libXcomposite + xorg.libXcursor + xorg.libXdamage + xorg.libXext + xorg.libXfixes + xorg.libXi + xorg.libXrandr + xorg.libXrender + xorg.libXtst + ]; +in +stdenv.mkDerivation rec { + name = "keybase-gui-${version}"; + version = "1.0.18-20170209170023.17b641d"; + src = fetchurl { + url = "https://s3.amazonaws.com/prerelease.keybase.io/linux_binaries/deb/keybase_${version}_amd64.deb"; + sha256 = "01mr6hyzs208g3ankl4swikna66n85xzn7ig4k7p6hxmnnvplgb3"; + }; + phases = ["unpackPhase" "installPhase" "fixupPhase"]; + unpackPhase = '' + ar xf $src + tar xf data.tar.xz + ''; + installPhase = '' + mkdir -p $out/{bin,share} + mv opt/keybase $out/share/ + + cat > $out/bin/keybase-gui <&2 + exit 1 + } + + if [ ! -S "\$XDG_RUNTIME_DIR/keybase/keybased.sock" ]; then + echo "Keybase service doesn't seem to be running." >&2 + echo "You might need to run: keybase service" >&2 + checkFailed + fi + + ${utillinuxMinimal}/bin/mountpoint /keybase &>/dev/null + if [ "\$?" -ne "0" ]; then + echo "Keybase is not mounted to /keybase." >&2 + echo "You might need to run: kbfsfuse /keybase" >&2 + checkFailed + fi + + exec $out/share/keybase/Keybase "\$@" + EOF + chmod +x $out/bin/keybase-gui + ''; + postFixup = '' + patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --set-rpath "${libPath}:\$ORIGIN" "$out/share/keybase/Keybase" + ''; + + meta = with stdenv.lib; { + homepage = https://www.keybase.io/; + description = "The Keybase official GUI."; + platforms = platforms.linux; + maintainers = with maintainers; [ puffnfresh ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5dea365f4854..34532300afd4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2415,6 +2415,8 @@ with pkgs; kbfs = callPackage ../tools/security/kbfs { }; + keybase-gui = callPackage ../tools/security/keybase-gui { }; + keychain = callPackage ../tools/misc/keychain { }; keyfuzz = callPackage ../tools/inputmethods/keyfuzz { };