1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 nixosTests,
6}:
7
8buildGoModule rec {
9 pname = "cadvisor";
10 version = "0.53.0";
11
12 src = fetchFromGitHub {
13 owner = "google";
14 repo = "cadvisor";
15 rev = "v${version}";
16 hash = "sha256-caGzjv7XhIst3JZA0ri97XqQOO3mI+hwS8WJmLk9f7g=";
17 };
18
19 modRoot = "./cmd";
20
21 vendorHash = "sha256-xUhHo/kDnjAQLuaeFG1EouC2FWBnFhj1RawlQX7ggVs=";
22
23 ldflags = [
24 "-s"
25 "-w"
26 "-X github.com/google/cadvisor/version.Version=${version}"
27 ];
28
29 postInstall = ''
30 mv $out/bin/{cmd,cadvisor}
31 rm $out/bin/example
32 '';
33
34 passthru.tests = { inherit (nixosTests) cadvisor; };
35
36 meta = with lib; {
37 description = "Analyzes resource usage and performance characteristics of running docker containers";
38 mainProgram = "cadvisor";
39 homepage = "https://github.com/google/cadvisor";
40 license = licenses.asl20;
41 maintainers = with maintainers; [ offline ];
42 platforms = platforms.linux;
43 };
44}