Skip to content

Commit

Permalink
yamlfmt: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
fabaff authored Nov 2, 2024
1 parent 9700c8f commit 9177462
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions pkgs/development/tools/yamlfmt/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{ lib, buildGoModule, fetchFromGitHub, testers, yamlfmt }:
{
lib,
buildGoModule,
fetchFromGitHub,
testers,
yamlfmt,
}:

buildGoModule rec {
pname = "yamlfmt";
version = "0.14.0";

src = fetchFromGitHub {
owner = "google";
repo = pname;
rev = "v${version}";
repo = "yamlfmt";
rev = "refs/tags/v${version}";
hash = "sha256-l9PtVaAKjtP9apTrKCkC1KDR0IXqLqinpj1onzSrPnI=";
};

Expand All @@ -16,8 +22,8 @@ buildGoModule rec {
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
"-X main.commit=${src.rev}"
"-X=main.version=${version}"
"-X=main.commit=${src.rev}"
];

passthru.tests.version = testers.testVersion {
Expand All @@ -27,6 +33,7 @@ buildGoModule rec {
meta = with lib; {
description = "Extensible command line tool or library to format yaml files";
homepage = "https://github.com/google/yamlfmt";
changelog = "https://github.com/google/yamlfmt/releases/tag/v${version}";
license = licenses.asl20;
maintainers = with maintainers; [ sno2wman ];
mainProgram = "yamlfmt";
Expand Down

0 comments on commit 9177462

Please sign in to comment.