From 857a3b872c430fd9a2fb09a07146ad0a9af36e07 Mon Sep 17 00:00:00 2001 From: pajowu Date: Mon, 10 Apr 2017 19:53:16 +0200 Subject: [PATCH 1/5] browserpass: init at 1.0.2 --- nixos/modules/module-list.nix | 1 + nixos/modules/programs/browserpass.nix | 26 +++++++++++++++ pkgs/tools/security/browserpass/default.nix | 35 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 4 files changed, 64 insertions(+) create mode 100644 nixos/modules/programs/browserpass.nix create mode 100644 pkgs/tools/security/browserpass/default.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index f7608a57d714..75b96bbd4141 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -71,6 +71,7 @@ ./programs/atop.nix ./programs/bash/bash.nix ./programs/blcr.nix + ./programs/browserpass.nix ./programs/cdemu.nix ./programs/chromium.nix ./programs/command-not-found/command-not-found.nix diff --git a/nixos/modules/programs/browserpass.nix b/nixos/modules/programs/browserpass.nix new file mode 100644 index 000000000000..f550334c84cc --- /dev/null +++ b/nixos/modules/programs/browserpass.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + + ###### interface + options = { + programs.browserpass = { + enable = mkOption { + default = false; + type = types.bool; + description = '' + Wheter to install the NativeMessaging configuration for installed browsers. + ''; + }; + }; + }; + + ###### implementation + config = mkIf config.programs.browserpass.enable { + environment.systemPackages = [ pkgs.browserpass ]; + environment.etc."chromium/native-messaging-hosts/com.dannyvankooten.browserpass.json".source = "${pkgs.browserpass}/etc/chrome-host.json"; + environment.etc."opt/chrome/native-messaging-hosts/com.dannyvankooten.browserpass.json".source = "${pkgs.browserpass}/etc/chrome-host.json"; + }; +} diff --git a/pkgs/tools/security/browserpass/default.nix b/pkgs/tools/security/browserpass/default.nix new file mode 100644 index 000000000000..dee0522115c1 --- /dev/null +++ b/pkgs/tools/security/browserpass/default.nix @@ -0,0 +1,35 @@ +{ 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"]; + }; + } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 45562df31700..8d95c61c7c63 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -543,6 +543,8 @@ with pkgs; pass = callPackage ../tools/security/pass { }; + browserpass = callPackage ../tools/security/browserpass { }; + oracle-instantclient = callPackage ../development/libraries/oracle-instantclient { }; kwakd = callPackage ../servers/kwakd { }; From b70077f551e3ca5a6ef5c275746a6c37468117e9 Mon Sep 17 00:00:00 2001 From: pajowu Date: Mon, 10 Apr 2017 23:21:20 +0200 Subject: [PATCH 2/5] browserpass: switch build source to git HEAD Precompiled version only supports linux64, git version should also support darwin --- nixos/modules/programs/browserpass.nix | 2 +- pkgs/tools/security/browserpass/default.nix | 55 ++++++++++----------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/nixos/modules/programs/browserpass.nix b/nixos/modules/programs/browserpass.nix index f550334c84cc..2b7ec1856431 100644 --- a/nixos/modules/programs/browserpass.nix +++ b/nixos/modules/programs/browserpass.nix @@ -11,7 +11,7 @@ with lib; default = false; type = types.bool; description = '' - Wheter to install the NativeMessaging configuration for installed browsers. + Whether to install the NativeMessaging configuration for installed browsers. ''; }; }; 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}"; +# This file was generated by https://github.com/kamilchm/go2nix v1.2.0 +{ stdenv, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn }: - version = "1.0.2"; +buildGoPackage rec { + name = "browserpass-unstable-${version}"; + version = "HEAD"; + rev = "HEAD"; - src = fetchzip { - url = "https://github.com/dannyvankooten/browserpass/releases/download/${version}/browserpass-linux64.zip"; - sha256 = "1fj2siczm472xd1n5i5k08cw94q5gpisfqmvrhhwq7zdjvpcrh8y"; - stripRoot = false; - }; + goPackagePath = "github.com/dannyvankooten/browserpass"; - dontBuild = true; + src = fetchgit { + inherit rev; + url = "https://github.com/dannyvankooten/browserpass"; + }; - installPhase = '' - install -D browserpass-linux64 "$out/bin/browserpass" + postInstall = '' + host_file="$bin/bin/browserpass" + mkdir -p "$bin/etc" - 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 + 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 "$out/etc/chrome-host.json" - install -D firefox-host.json "$out/etc/firefox-host.json" + install -D chrome-host.json $bin/etc/chrome-host.json + install -D firefox-host.json $bin/etc/firefox-host.json + ''; - ''; - - - meta = with lib; { - maintainers = with maintainers; [ cstrahan ]; - platforms = ["x86_64-linux"]; - }; - } + 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 From 11913f2ce13d887485c72e6c34dcec613f56fdb4 Mon Sep 17 00:00:00 2001 From: pajowu Date: Tue, 11 Apr 2017 17:32:33 +0200 Subject: [PATCH 3/5] browserpass: change naming scheme --- pkgs/tools/security/browserpass/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/security/browserpass/default.nix b/pkgs/tools/security/browserpass/default.nix index 85678145b824..6f3ae87c24d8 100644 --- a/pkgs/tools/security/browserpass/default.nix +++ b/pkgs/tools/security/browserpass/default.nix @@ -2,15 +2,16 @@ { stdenv, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn }: buildGoPackage rec { - name = "browserpass-unstable-${version}"; - version = "HEAD"; - rev = "HEAD"; + name = "browserpass-${version}"; + version = "2017-04-11"; + rev = "e0fe250ed8fd061125746f5d99a1f9a678d21004"; goPackagePath = "github.com/dannyvankooten/browserpass"; src = fetchgit { inherit rev; url = "https://github.com/dannyvankooten/browserpass"; + sha256 = "0khwlh5agdd2mm2yzklg8r2h084n8j7jbjjxsiaj67zm8zz6b39c"; }; postInstall = '' From b4caf7a11e8943e0263df41ba8dd9f21ff18f58e Mon Sep 17 00:00:00 2001 From: pajowu Date: Sat, 22 Apr 2017 15:13:02 +0200 Subject: [PATCH 4/5] browserpass: add support for firefox --- pkgs/tools/security/browserpass/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/security/browserpass/default.nix b/pkgs/tools/security/browserpass/default.nix index 6f3ae87c24d8..6d14abbb34a7 100644 --- a/pkgs/tools/security/browserpass/default.nix +++ b/pkgs/tools/security/browserpass/default.nix @@ -22,7 +22,7 @@ buildGoPackage rec { 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 + install -D firefox-host.json $bin/lib/mozilla/native-messaging-hosts/com.dannyvankooten.browserpass.json ''; meta = { @@ -32,4 +32,4 @@ buildGoPackage rec { license = stdenv.lib.licenses.mit; platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; }; -} \ No newline at end of file +} From 1a380c094fbc428e152d781b44219662c4c4e36b Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Mon, 1 May 2017 11:27:03 +0200 Subject: [PATCH 5/5] Remove empty longDescription --- pkgs/tools/security/browserpass/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/tools/security/browserpass/default.nix b/pkgs/tools/security/browserpass/default.nix index 6d14abbb34a7..edc46fee5828 100644 --- a/pkgs/tools/security/browserpass/default.nix +++ b/pkgs/tools/security/browserpass/default.nix @@ -27,7 +27,6 @@ buildGoPackage rec { 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;