Commit cfe0dd5b authored by Paul Meyer's avatar Paul Meyer
Browse files

keep-sorted: use finalAttrs

parent 2d23979e
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -6,14 +6,14 @@
  versionCheckHook,
}:

buildGoModule rec {
buildGoModule (finalAttrs: {
  pname = "keep-sorted";
  version = "0.6.1";

  src = fetchFromGitHub {
    owner = "google";
    repo = "keep-sorted";
    tag = "v${version}";
    tag = "v${finalAttrs.version}";
    hash = "sha256-N/fJ0qj7/kQ9Q7ULpQpyhWAWFlnLkTjyNNKg8VhLvi0=";
  };

@@ -22,7 +22,7 @@ buildGoModule rec {
  # Inject version string instead of reading version from buildinfo.
  postPatch = ''
    substituteInPlace main.go \
      --replace-fail 'readVersion())' '"v${version}")'
      --replace-fail 'readVersion())' '"v${finalAttrs.version}")'
  '';

  env.CGO_ENABLED = "0";
@@ -41,11 +41,11 @@ buildGoModule rec {
  passthru.updateScript = nix-update-script { };

  meta = {
    changelog = "https://github.com/google/keep-sorted/releases/tag/v${version}";
    changelog = "https://github.com/google/keep-sorted/releases/tag/v${finalAttrs.version}";
    description = "Language-agnostic formatter that sorts lines between two markers in a larger file";
    homepage = "https://github.com/google/keep-sorted";
    license = lib.licenses.asl20;
    mainProgram = "keep-sorted";
    maintainers = with lib.maintainers; [ katexochen ];
  };
}
})