2015-07-31 00:30:15 +01:00
|
|
|
{ stdenv, fetchurl, fetchgit, curl, scrot, imagemagick, xawtv, inetutils, makeWrapper, coreutils
|
2013-10-14 16:13:50 +01:00
|
|
|
, apiKey ? ""
|
|
|
|
, deviceKey ? "" }:
|
2013-10-14 10:57:40 +01:00
|
|
|
|
|
|
|
# TODO: this should assert keys are set, somehow if set through .override assertion fails
|
2013-10-14 16:13:50 +01:00
|
|
|
#assert apiKey != "";
|
|
|
|
#assert deviceKey != "";
|
2013-10-14 10:57:40 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
modulesSrc = fetchgit {
|
|
|
|
url = "git://github.com/prey/prey-bash-client-modules.git";
|
|
|
|
rev = "aba260ef110834cb2e92923a31f50c15970639ee";
|
2013-11-19 00:13:32 +00:00
|
|
|
sha256 = "9cb1ad813d052a0a3e3bbdd329a8711ae3272e340379489511f7dd578d911e30";
|
2013-10-14 10:57:40 +01:00
|
|
|
};
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "prey-bash-client-${version}";
|
|
|
|
version = "0.6.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/prey/prey-bash-client/archive/v${version}.tar.gz";
|
|
|
|
sha256 = "09cb15jh4jdwvix9nx048ajkw2r5jaflk68y3rkha541n8n0qwh0";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ curl scrot imagemagick xawtv makeWrapper ];
|
|
|
|
|
|
|
|
phases = "unpackPhase installPhase";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
substituteInPlace config --replace api_key=\'\' "api_key='${apiKey}'"
|
|
|
|
substituteInPlace config --replace device_key=\'\' "device_key='${deviceKey}'"
|
|
|
|
|
|
|
|
substituteInPlace prey.sh --replace /bin/bash $(type -Pp bash)
|
|
|
|
mkdir -p $out/modules
|
|
|
|
cp -R . $out
|
|
|
|
cp -R ${modulesSrc}/* $out/modules/
|
|
|
|
wrapProgram "$out/prey.sh" \
|
2015-10-06 14:32:17 +01:00
|
|
|
--prefix PATH ":" "${xawtv}/bin:${imagemagick}/bin:${curl.bin}/bin:${scrot}/bin:${inetutils}/bin:${coreutils}/bin" \
|
2015-07-31 00:30:15 +01:00
|
|
|
--set CURL_CA_BUNDLE "/etc/ssl/certs/ca-certificates.crt"
|
2013-10-14 10:57:40 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = http://preyproject.com;
|
|
|
|
description = "Proven tracking software that helps you find, lock and recover your devices when stolen or missing";
|
2016-05-17 12:57:28 +01:00
|
|
|
maintainers = with maintainers; [ domenkozar ];
|
2013-10-14 10:57:40 +01:00
|
|
|
license = licenses.gpl3;
|
|
|
|
};
|
|
|
|
}
|