nix: initial tooling

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I5e9bfbc614604329d54240c02f620e156a6a6964
This commit is contained in:
raf 2026-01-21 15:02:50 +03:00
commit 7fe980d27b
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
5 changed files with 102 additions and 0 deletions

43
nix/package.nix Normal file
View file

@ -0,0 +1,43 @@
{
lib,
stdenv,
fetchPnpmDeps,
nodejs-slim,
pnpm,
pnpmConfigHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "nix-evaluator-stats";
version = "0.1.0";
src = ../.;
nativeBuildInputs = [
nodejs-slim
pnpm
pnpmConfigHook # dependency resolution
];
pnpmDeps = fetchPnpmDeps {
inherit (finalAttrs) pname src;
hash = "sha256-CpfaUvQbvOXljCqNwyMUJNDisnlrWCHBwhmdIzjmv+c=";
fetcherVersion = 3; # https://nixos.org/manual/nixpkgs/stable/#javascript-pnpm-fetcherVersion
};
buildPhase = ''
runHook preBuild
mkdir -p $out/share/dist
pnpm run build --outDir $out/share/dist
runHook postBuild
'';
meta = {
description = "Pretty visualiser for Nix evaluator stats";
homepage = "https://github.com/notashelf/nix-evaluator-stats";
platforms = ["x86_64-linux" "aarch64-linux"];
license = lib.licenses.mpl20;
maintainers = [lib.maintainers.NotAShelf];
};
})