depot/third_party/nixpkgs/pkgs/by-name/ca/cadvisor/package.nix

35 lines
933 B
Nix

{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "cadvisor";
version = "0.49.1";
src = fetchFromGitHub {
owner = "google";
repo = "cadvisor";
rev = "v${version}";
hash = "sha256-Hr9L9cewJN1ibh+6L0XhxxNAH4U8TrK+j7YBjS6FzZc=";
};
modRoot = "./cmd";
vendorHash = "sha256-9h+W+zuwxlpkBaCpk1otrBrwfyitfGLViOcZRpKB3uU=";
ldflags = [ "-s" "-w" "-X github.com/google/cadvisor/version.Version=${version}" ];
postInstall = ''
mv $out/bin/{cmd,cadvisor}
rm $out/bin/example
'';
passthru.tests = { inherit (nixosTests) cadvisor; };
meta = with lib; {
description = "Analyzes resource usage and performance characteristics of running docker containers";
mainProgram = "cadvisor";
homepage = "https://github.com/google/cadvisor";
license = licenses.asl20;
maintainers = with maintainers; [ offline ];
platforms = platforms.linux;
};
}