about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/security/prey
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/tools/security/prey
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/tools/security/prey')
-rw-r--r--nixpkgs/pkgs/tools/security/prey/default.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/security/prey/default.nix b/nixpkgs/pkgs/tools/security/prey/default.nix
new file mode 100644
index 000000000000..ab041c8b05d6
--- /dev/null
+++ b/nixpkgs/pkgs/tools/security/prey/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchurl, fetchgit, curl, scrot, imagemagick, xawtv, inetutils, makeWrapper, coreutils
+, apiKey ? ""
+, deviceKey ? "" }:
+
+# TODO: this should assert keys are set, somehow if set through .override assertion fails
+#assert apiKey != "";
+#assert deviceKey != "";
+
+let
+  modulesSrc = fetchgit {
+    url = "git://github.com/prey/prey-bash-client-modules.git";
+    rev = "aba260ef110834cb2e92923a31f50c15970639ee";
+    sha256 = "9cb1ad813d052a0a3e3bbdd329a8711ae3272e340379489511f7dd578d911e30";
+  };
+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" \
+      --prefix PATH ":" "${stdenv.lib.makeBinPath [ xawtv imagemagick curl scrot inetutils coreutils ]}" \
+      --set CURL_CA_BUNDLE "/etc/ssl/certs/ca-certificates.crt"
+  '';
+
+  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";
+    maintainers = with maintainers; [ domenkozar ];
+    license = licenses.gpl3;
+    platforms = with platforms; linux;
+  };
+}