nixpkgs/pkgs/by-name/ca/cadvisor/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

36 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;
};
}