Commit 9a036b3b authored by aileot's avatar aileot
Browse files

gibo: use versionCheckHook

Note that `writableTmpDirAsHomeHook` with `$HOME` is necessary to pass
the version check; `gibo` requires either `$XDG_CACHE_HOME` or `$HOME`,
none of which are otherwise defined in running `versionCheckHook`, to
store `gibo`'s boilerplate caches.

https://github.com/NixOS/nixpkgs/pull/422670#pullrequestreview-3021069843



Co-authored-by: default avatarGrimmauld <soeren@benjos.de>
parent 55d480bc
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -3,7 +3,9 @@
  buildGoModule,
  fetchFromGitHub,
  nix-update-script,
  versionCheckHook,
  installShellFiles,
  writableTmpDirAsHomeHook,
}:
buildGoModule (finalAttrs: {
  pname = "gibo";
@@ -35,11 +37,13 @@ buildGoModule (finalAttrs: {
      --zsh <($out/bin/gibo completion zsh)
  '';

  installCheckPhase = ''
    runHook preInstallCheck
    $out/bin/gibo version | grep -F "${finalAttrs.version}"
    runHook postInstallCheck
  '';
  doInstallCheck = true;
  nativeInstallCheckInputs = [
    versionCheckHook
    writableTmpDirAsHomeHook
  ];
  versionCheckProgramArg = "version";
  versionCheckKeepEnvironment = [ "HOME" ];

  passthru.updateScript = nix-update-script { };