diff --git a/nixos/modules/programs/browserpass.nix b/nixos/modules/programs/browserpass.nix index f550334c84c..2b7ec185643 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 dee0522115c..85678145b82 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