tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
kor: use finalAttrs and versionCheckHook
Daniel Nagy
5 months ago
65b5bcff
585affb2
+12
-8
1 changed file
expand all
collapse all
unified
split
pkgs
by-name
ko
kor
package.nix
+12
-8
pkgs/by-name/ko/kor/package.nix
···
2
2
lib,
3
3
buildGoModule,
4
4
fetchFromGitHub,
5
5
+
writableTmpDirAsHomeHook,
6
6
+
versionCheckHook,
5
7
}:
6
8
7
7
-
buildGoModule rec {
9
9
+
buildGoModule (finalAttrs: {
8
10
pname = "kor";
9
11
version = "0.6.4";
10
12
11
13
src = fetchFromGitHub {
12
14
owner = "yonahd";
13
15
repo = "kor";
14
14
-
rev = "v${version}";
16
16
+
tag = "v${finalAttrs.version}";
15
17
hash = "sha256-hGiak28gwxwYOogYyZjTgQ+aGSumxzeZiQKlbVvvrIU=";
16
18
};
17
19
18
20
vendorHash = "sha256-a7B0cJi71mqGDPbXaWYKZ2AeuuQyNDxwWNgahTN5AW8=";
19
21
20
20
-
preCheck = ''
21
21
-
HOME=$(mktemp -d)
22
22
-
export HOME
23
23
-
'';
22
22
+
nativeCheckInputs = [ writableTmpDirAsHomeHook ];
24
23
25
24
ldflags = [
26
25
"-s"
27
26
"-w"
27
27
+
"-X github.com/yonahd/kor/pkg/utils.Version=${finalAttrs.version}"
28
28
];
29
29
30
30
+
nativeInstallCheckInputs = [ versionCheckHook ];
31
31
+
versionCheckProgramArg = "version";
32
32
+
doInstallCheck = true;
33
33
+
30
34
meta = {
31
35
description = "Golang Tool to discover unused Kubernetes Resources";
32
36
homepage = "https://github.com/yonahd/kor";
33
33
-
changelog = "https://github.com/yonahd/kor/releases/tag/v${version}";
37
37
+
changelog = "https://github.com/yonahd/kor/releases/tag/v${finalAttrs.version}";
34
38
license = lib.licenses.mit;
35
39
maintainers = [ lib.maintainers.ivankovnatsky ];
36
40
mainProgram = "kor";
37
41
};
38
38
-
}
42
42
+
})