parca: init at 0.22.0 (#359635)

authored by Jon Seager and committed by GitHub cf99465f e405f305

+80
+80
pkgs/by-name/pa/parca/package.nix
··· 1 + { 2 + buildGoModule, 3 + faketty, 4 + fetchFromGitHub, 5 + lib, 6 + nodejs, 7 + pnpm, 8 + stdenv, 9 + }: 10 + let 11 + version = "0.22.0"; 12 + 13 + parca-src = fetchFromGitHub { 14 + owner = "parca-dev"; 15 + repo = "parca"; 16 + rev = "refs/tags/v${version}"; 17 + hash = "sha256-iuTlKUmugRum0qZRhuw0FR13iE2qrQegTgwpAvgJSXk="; 18 + }; 19 + 20 + ui = stdenv.mkDerivation (finalAttrs: { 21 + inherit version; 22 + pname = "parca-ui"; 23 + src = "${parca-src}/ui"; 24 + 25 + pnpmDeps = pnpm.fetchDeps { 26 + inherit (finalAttrs) pname src version; 27 + hash = "sha256-MVNO24Oksy/qRUmEUoWoviQEo6Eimb18ZnDj5Z1vJkY="; 28 + }; 29 + 30 + nativeBuildInputs = [ 31 + faketty 32 + nodejs 33 + pnpm.configHook 34 + ]; 35 + 36 + # faketty is required to work around a bug in nx. 37 + # See: https://github.com/nrwl/nx/issues/22445 38 + buildPhase = '' 39 + runHook preBuild 40 + faketty pnpm build 41 + runHook postBuild 42 + ''; 43 + 44 + installPhase = '' 45 + runHook preInstall 46 + mkdir -p $out/share/parca 47 + mv packages/app/web/build $out/share/parca/ui 48 + runHook postInstall 49 + ''; 50 + }); 51 + in 52 + 53 + buildGoModule rec { 54 + inherit version; 55 + 56 + pname = "parca"; 57 + src = parca-src; 58 + 59 + vendorHash = "sha256-fErrbi3iSJlkguqzL6nH+fzmjxhoYVl1qH7tqRR1F1A="; 60 + 61 + ldflags = [ 62 + "-X=main.version=${version}" 63 + "-X=main.commit=${src.rev}" 64 + ]; 65 + 66 + preBuild = '' 67 + # Copy the built UI into the right place for the Go build to embed it. 68 + cp -r ${ui}/share/parca/ui/* ui/packages/app/web/build 69 + ''; 70 + 71 + meta = { 72 + mainProgram = "parca"; 73 + description = "Continuous profiling for analysis of CPU and memory usage"; 74 + homepage = "https://github.com/parca-dev/parca"; 75 + changelog = "https://github.com/parca-dev/parca/releases/tag/v${version}"; 76 + license = lib.licenses.asl20; 77 + platforms = lib.platforms.linux; 78 + maintainers = with lib.maintainers; [ jnsgruk ]; 79 + }; 80 + }