From b70077f551e3ca5a6ef5c275746a6c37468117e9 Mon Sep 17 00:00:00 2001 From: pajowu Date: Mon, 10 Apr 2017 23:21:20 +0200 Subject: browserpass: switch build source to git HEAD Precompiled version only supports linux64, git version should also support darwin --- pkgs/tools/security/browserpass/default.nix | 69 ++++++++++++++--------------- 1 file changed, 34 insertions(+), 35 deletions(-) (limited to 'pkgs/tools/security/browserpass') diff --git a/pkgs/tools/security/browserpass/default.nix b/pkgs/tools/security/browserpass/default.nix index dee0522115c18..85678145b8242 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 -- cgit 1.4.1