Unverified Commit 14b4dacd authored by Zexin Yuan's avatar Zexin Yuan
Browse files

git-credential-gopass: remove dependency on gopass, add version check

parent d1347ec9
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -3,7 +3,9 @@
  buildGoModule,
  fetchFromGitHub,
  makeWrapper,
  writableTmpDirAsHomeHook,
  gopass,
  versionCheckHook,
}:

buildGoModule (finalAttrs: {
@@ -21,7 +23,10 @@ buildGoModule (finalAttrs: {

  subPackages = [ "." ];

  nativeBuildInputs = [ makeWrapper ];
  nativeBuildInputs = [
    makeWrapper
    writableTmpDirAsHomeHook
  ];

  ldflags = [
    "-s"
@@ -32,7 +37,17 @@ buildGoModule (finalAttrs: {

  postFixup = ''
    wrapProgram $out/bin/git-credential-gopass \
      --prefix PATH : "${lib.makeBinPath [ gopass ]}"
      --prefix PATH : "${gopass.wrapperPath}"
  '';

  doInstallCheck = true;
  nativeInstallCheckInputs = [
    versionCheckHook
    gopass
  ];
  versionCheckKeepEnvironment = [ "HOME" ];
  preVersionCheck = ''
    gopass setup --name "user" --email "user@localhost"
  '';

  meta = {