Commit e547f4f2 authored by Pol Dellaiera's avatar Pol Dellaiera
Browse files

atlantis: use `versionCheckHook`

parent 21d9d56c
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -2,20 +2,22 @@
  lib,
  buildGoModule,
  fetchFromGitHub,
  versionCheckHook,
}:

buildGoModule rec {
buildGoModule (finalAttrs: {
  pname = "atlantis";
  version = "0.34.0";

  src = fetchFromGitHub {
    owner = "runatlantis";
    repo = "atlantis";
    rev = "v${version}";
    tag = "v${finalAttrs.version}";
    hash = "sha256-2xgU3H6X9EcbySV9RXN5oCn+7EkfdwebeYsL5+Vl69E=";
  };

  ldflags = [
    "-X=main.version=${version}"
    "-X=main.version=${finalAttrs.version}"
    "-X=main.date=1970-01-01T00:00:00Z"
  ];

@@ -24,15 +26,15 @@ buildGoModule rec {
  subPackages = [ "." ];

  doInstallCheck = true;
  installCheckPhase = ''
    $out/bin/atlantis version | grep ${version} > /dev/null
  '';
  nativeInstallCheckInputs = [ versionCheckHook ];
  versionCheckProgram = "${placeholder "out"}/bin/atlantis";
  versionCheckProgramArg = "version";

  meta = with lib; {
  meta = {
    homepage = "https://github.com/runatlantis/atlantis";
    description = "Terraform Pull Request Automation";
    mainProgram = "atlantis";
    license = licenses.asl20;
    maintainers = with maintainers; [ jpotier ];
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ jpotier ];
  };
}
})