summary refs log tree commit diff
path: root/pkgs/tools/security
diff options
context:
space:
mode:
authorpajowu <git@ca.pajowu.de>2017-04-10 23:21:20 +0200
committerpajowu <git@ca.pajowu.de>2017-04-10 23:45:41 +0200
commitb70077f551e3ca5a6ef5c275746a6c37468117e9 (patch)
treeda728f1ca9917fb4ec872ceee52204f6ee476b40 /pkgs/tools/security
parent857a3b872c430fd9a2fb09a07146ad0a9af36e07 (diff)
downloadnixlib-b70077f551e3ca5a6ef5c275746a6c37468117e9.tar
nixlib-b70077f551e3ca5a6ef5c275746a6c37468117e9.tar.gz
nixlib-b70077f551e3ca5a6ef5c275746a6c37468117e9.tar.bz2
nixlib-b70077f551e3ca5a6ef5c275746a6c37468117e9.tar.lz
nixlib-b70077f551e3ca5a6ef5c275746a6c37468117e9.tar.xz
nixlib-b70077f551e3ca5a6ef5c275746a6c37468117e9.tar.zst
nixlib-b70077f551e3ca5a6ef5c275746a6c37468117e9.zip
browserpass: switch build source to git HEAD
Precompiled version only supports linux64, git version should also support darwin
Diffstat (limited to 'pkgs/tools/security')
-rw-r--r--pkgs/tools/security/browserpass/default.nix69
1 files changed, 34 insertions, 35 deletions
diff --git a/pkgs/tools/security/browserpass/default.nix b/pkgs/tools/security/browserpass/default.nix
index dee0522115c1..85678145b824 100644
--- a/pkgs/tools/security/browserpass/default.nix
+++ b/pkgs/tools/security/browserpass/default.nix
@@ -1,35 +1,34 @@
-{ stdenv, lib, fetchzip }:
-let 
-  userDir = "~/.config/chromium";
-in
-  stdenv.mkDerivation rec {
-    name = "browserpass-${version}";
-
-    version = "1.0.2";
-
-    src = fetchzip {
-      url = "https://github.com/dannyvankooten/browserpass/releases/download/${version}/browserpass-linux64.zip";
-      sha256 = "1fj2siczm472xd1n5i5k08cw94q5gpisfqmvrhhwq7zdjvpcrh8y";
-      stripRoot = false;
-    };
-
-    dontBuild = true;
-
-    installPhase = ''
-      install -D browserpass-linux64 "$out/bin/browserpass"
-
-      host_file="$out/bin/browserpass"
-      sed -i -e "s!%%replace%%!$host_file!" chrome-host.json
-      sed -i -e "s!%%replace%%!$host_file!" firefox-host.json
-
-      install -D chrome-host.json "$out/etc/chrome-host.json"
-      install -D firefox-host.json "$out/etc/firefox-host.json"
-
-    '';
-
-
-    meta = with lib; {
-      maintainers = with maintainers; [ cstrahan ];
-      platforms   = ["x86_64-linux"];
-    };
-  }
+# This file was generated by https://github.com/kamilchm/go2nix v1.2.0
+{ stdenv, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn }:
+
+buildGoPackage rec {
+  name = "browserpass-unstable-${version}";
+  version = "HEAD";
+  rev = "HEAD";
+
+  goPackagePath = "github.com/dannyvankooten/browserpass";
+
+  src = fetchgit {
+    inherit rev;
+    url = "https://github.com/dannyvankooten/browserpass";
+  };
+
+  postInstall = ''
+      host_file="$bin/bin/browserpass"
+      mkdir -p "$bin/etc"
+
+      sed -e "s!%%replace%%!$host_file!" go/src/${goPackagePath}/chrome/host.json > chrome-host.json
+      sed -e "s!%%replace%%!$host_file!" go/src/${goPackagePath}/firefox/host.json > firefox-host.json
+
+      install -D chrome-host.json $bin/etc/chrome-host.json
+      install -D firefox-host.json $bin/etc/firefox-host.json
+  '';
+
+  meta = {
+    description = "A Chrome & Firefox extension for zx2c4's pass";
+    longDescription = "";
+    homepage = "https://github.com/dannyvankooten/browserpass";
+    license = stdenv.lib.licenses.mit;
+    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+  };
+}
\ No newline at end of file