Skip to content

Commit 3ecf126

Browse files
authored
use finalAttrs on Go packages I maintain (#397910)
2 parents 530c64a + 978d35f commit 3ecf126

File tree

11 files changed

+45
-45
lines changed

11 files changed

+45
-45
lines changed

pkgs/by-name/at/athens/package.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
athens,
77
}:
88

9-
buildGoModule rec {
9+
buildGoModule (finalAttrs: {
1010
pname = "athens";
1111
version = "0.15.4";
1212

1313
src = fetchFromGitHub {
1414
owner = "gomods";
1515
repo = "athens";
16-
rev = "v${version}";
16+
tag = "v${finalAttrs.version}";
1717
hash = "sha256-6NBdif8rQ1aj4nTYXhrWyErzRv0q8WpIheRnb2FCnkU=";
1818
};
1919

@@ -22,7 +22,7 @@ buildGoModule rec {
2222
env.CGO_ENABLED = "0";
2323
ldflags = [
2424
"-s"
25-
"-X github.com/gomods/athens/pkg/build.version=${version}"
25+
"-X github.com/gomods/athens/pkg/build.version=${finalAttrs.version}"
2626
];
2727

2828
subPackages = [ "cmd/proxy" ];
@@ -47,4 +47,4 @@ buildGoModule rec {
4747
];
4848
platforms = platforms.unix;
4949
};
50-
}
50+
})

pkgs/by-name/bl/bluetuith/package.nix

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
nix-update-script,
66
}:
77

8-
buildGoModule rec {
8+
buildGoModule (finalAttrs: {
99
pname = "bluetuith";
1010
version = "0.2.3";
1111

1212
src = fetchFromGitHub {
1313
owner = "darkhz";
14-
repo = pname;
15-
rev = "v${version}";
14+
repo = "bluetuith";
15+
tag = "v${finalAttrs.version}";
1616
hash = "sha256-yXH/koNT4ec/SOZhSU01iPNAfD1MdMjM2+wNmjXWsrk=";
1717
};
1818

@@ -23,7 +23,7 @@ buildGoModule rec {
2323
ldflags = [
2424
"-s"
2525
"-w"
26-
"-X github.com/darkhz/bluetuith/cmd.Version=${version}@nixpkgs"
26+
"-X github.com/darkhz/bluetuith/cmd.Version=${finalAttrs.version}@nixpkgs"
2727
];
2828

2929
passthru.updateScript = nix-update-script { };
@@ -47,4 +47,4 @@ buildGoModule rec {
4747
katexochen
4848
];
4949
};
50-
}
50+
})

pkgs/by-name/ca/capslock/package.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
nix-update-script,
66
}:
77

8-
buildGoModule rec {
8+
buildGoModule (finalAttrs: {
99
pname = "capslock";
1010
version = "0.2.7";
1111

1212
src = fetchFromGitHub {
1313
owner = "google";
1414
repo = "capslock";
15-
rev = "v${version}";
15+
rev = "v${finalAttrs.version}";
1616
hash = "sha256-kRuEcrx9LBzCpXFWlc9bSsgZt84T8R8VFdbAWAseSPQ=";
1717
};
1818

@@ -33,4 +33,4 @@ buildGoModule rec {
3333
mainProgram = "capslock";
3434
maintainers = with lib.maintainers; [ katexochen ];
3535
};
36-
}
36+
})

pkgs/by-name/di/distribution/package.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
distribution,
88
}:
99

10-
buildGoModule rec {
10+
buildGoModule (finalAttrs: {
1111
pname = "distribution";
1212
version = "3.0.0";
1313

1414
src = fetchFromGitHub {
1515
owner = "distribution";
1616
repo = "distribution";
17-
tag = "v${version}";
17+
tag = "v${finalAttrs.version}";
1818
hash = "sha256-myezQTEdH7kkpCoAeZMf5OBxT4Bz8Qx6vCnwim230RY=";
1919
};
2020

@@ -30,7 +30,7 @@ buildGoModule rec {
3030
passthru = {
3131
tests.version = testers.testVersion {
3232
package = distribution;
33-
version = "v${version}";
33+
version = "v${finalAttrs.version}";
3434
};
3535
updateScript = nix-update-script { };
3636
};
@@ -50,4 +50,4 @@ buildGoModule rec {
5050
mainProgram = "registry";
5151
platforms = platforms.unix;
5252
};
53-
}
53+
})

pkgs/by-name/go/go-critic/package.nix

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
go-critic,
88
}:
99

10-
buildGoModule rec {
10+
buildGoModule (finalAttrs: {
1111
pname = "go-critic";
1212
version = "0.13.0";
1313

1414
src = fetchFromGitHub {
1515
owner = "go-critic";
1616
repo = "go-critic";
17-
rev = "v${version}";
17+
rev = "v${finalAttrs.version}";
1818
hash = "sha256-0AOhq7OhSHub4I6XXL018hg6i2ERkIbZCrO9osNjvHw=";
1919
};
2020

@@ -27,7 +27,7 @@ buildGoModule rec {
2727
allowGoReference = true;
2828

2929
ldflags = [
30-
"-X main.Version=${version}"
30+
"-X main.Version=${finalAttrs.version}"
3131
];
3232

3333
passthru = {
@@ -41,9 +41,9 @@ buildGoModule rec {
4141
meta = {
4242
description = "Most opinionated Go source code linter for code audit";
4343
homepage = "https://go-critic.com/";
44-
changelog = "https://github.com/go-critic/go-critic/releases/tag/${src.rev}";
44+
changelog = "https://github.com/go-critic/go-critic/releases/tag/${finalAttrs.src.rev}";
4545
license = lib.licenses.mit;
4646
mainProgram = "gocritic";
4747
maintainers = with lib.maintainers; [ katexochen ];
4848
};
49-
}
49+
})

pkgs/by-name/go/gobusybox/package.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
fetchFromGitHub,
55
}:
66

7-
buildGoModule rec {
7+
buildGoModule (finalAttrs: {
88
pname = "gobusybox";
99
version = "0.2.0-unstable-2024-03-05";
1010

@@ -15,7 +15,7 @@ buildGoModule rec {
1515
hash = "sha256-hS6YwN6eekyDjp7E6sisW+8HO5WHTEC68XyKZFPihK4=";
1616
};
1717

18-
sourceRoot = "${src.name}/src";
18+
sourceRoot = "${finalAttrs.src.name}/src";
1919

2020
subPackages = [
2121
"cmd/gencmddeps"
@@ -39,4 +39,4 @@ buildGoModule rec {
3939
maintainers = with lib.maintainers; [ katexochen ];
4040
mainProgram = "makebb";
4141
};
42-
}
42+
})

pkgs/by-name/gr/grmon/package.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
nix-update-script,
66
}:
77

8-
buildGoModule rec {
8+
buildGoModule (finalAttrs: {
99
pname = "grmon";
1010
version = "0.1";
1111

1212
src = fetchFromGitHub {
1313
owner = "bcicen";
1414
repo = "grmon";
15-
rev = "v${version}";
15+
rev = "v${finalAttrs.version}";
1616
hash = "sha256-0J7f4DMADUut3Da0F1eTDsT1Hlk0rfInwzbcVcQNzg8=";
1717
};
1818

@@ -35,4 +35,4 @@ buildGoModule rec {
3535
mainProgram = "grmon";
3636
maintainers = with maintainers; [ katexochen ];
3737
};
38-
}
38+
})

pkgs/by-name/jj/jj/package.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
runCommand,
99
jj,
1010
}:
11-
buildGoModule rec {
11+
buildGoModule (finalAttrs: {
1212
pname = "jj";
1313
version = "1.9.2";
1414

1515
src = fetchFromGitHub {
1616
owner = "tidwall";
1717
repo = "jj";
18-
rev = "v${version}";
18+
rev = "v${finalAttrs.version}";
1919
hash = "sha256-Yijap5ZghTBe1ahkQgjjxuo++SriJWXgRqrNXIVQ0os=";
2020
};
2121

@@ -28,7 +28,7 @@ buildGoModule rec {
2828
ldflags = [
2929
"-s"
3030
"-w"
31-
"-X main.version=${version}"
31+
"-X main.version=${finalAttrs.version}"
3232
];
3333

3434
passthru = {
@@ -71,4 +71,4 @@ buildGoModule rec {
7171
mainProgram = "jj";
7272
maintainers = with maintainers; [ katexochen ];
7373
};
74-
}
74+
})

pkgs/by-name/ke/keep-sorted/package.nix

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
versionCheckHook,
77
}:
88

9-
buildGoModule rec {
9+
buildGoModule (finalAttrs: {
1010
pname = "keep-sorted";
1111
version = "0.6.1";
1212

1313
src = fetchFromGitHub {
1414
owner = "google";
1515
repo = "keep-sorted";
16-
tag = "v${version}";
16+
tag = "v${finalAttrs.version}";
1717
hash = "sha256-N/fJ0qj7/kQ9Q7ULpQpyhWAWFlnLkTjyNNKg8VhLvi0=";
1818
};
1919

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

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

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

pkgs/by-name/u-/u-root/package.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
linux_latest,
1111
}:
1212

13-
buildGoModule rec {
13+
buildGoModule (finalAttrs: {
1414
pname = "u-root";
1515
version = "0.14.0-unstable-2024-09-26";
1616

@@ -63,10 +63,10 @@ buildGoModule rec {
6363
'';
6464
homepage = "https://u-root.org/";
6565
downloadPage = "https://github.com/u-root/u-root";
66-
changelog = "https://github.com/u-root/u-root/blob/${src.rev}/RELEASES";
66+
changelog = "https://github.com/u-root/u-root/blob/${finalAttrs.src.rev}/RELEASES";
6767
license = lib.licenses.bsd3;
6868
maintainers = with lib.maintainers; [ katexochen ];
6969
mainProgram = "u-root";
7070
platforms = lib.platforms.linux;
7171
};
72-
}
72+
})

0 commit comments

Comments
 (0)