From 4269d8e8e6d16a86c285ddcf0dd931e80da2a04b Mon Sep 17 00:00:00 2001 From: Henri Rosten Date: Wed, 3 Apr 2024 10:42:29 +0300 Subject: [PATCH] nix-visualize: init at 1.0.5-unstable-2024-01-17 Signed-off-by: Henri Rosten --- .../nix-visualize/default.nix | 49 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 51 insertions(+) create mode 100644 pkgs/tools/package-management/nix-visualize/default.nix diff --git a/pkgs/tools/package-management/nix-visualize/default.nix b/pkgs/tools/package-management/nix-visualize/default.nix new file mode 100644 index 000000000000..9f1ba8b4d769 --- /dev/null +++ b/pkgs/tools/package-management/nix-visualize/default.nix @@ -0,0 +1,49 @@ +{ lib +, fetchFromGitHub +, nix +, python +, matplotlib +, networkx +, pandas +, pygraphviz +, setuptools +}: + +python.pkgs.buildPythonApplication rec { + version = "1.0.5-unstable-2024-01-17"; + pname = "nix-visualize"; + pyproject = true; + + src = fetchFromGitHub { + owner = "craigmbooth"; + repo = "nix-visualize"; + rev = "5b9beae330ac940df56433d347494505e2038904"; + hash = "sha256-VgEsR/Odddc7v6oq2tNcVwCYm08PhiqhZJueuEYCR0o="; + }; + + postInstall = '' + wrapProgram $out/bin/nix-visualize \ + --prefix PATH : ${lib.makeBinPath [nix]} + ''; + + nativeBuildInputs = [ setuptools ]; + + propagatedBuildInputs = [ + matplotlib + networkx + pandas + pygraphviz + ]; + + pythonImportsCheck = [ "nix_visualize" ]; + # No tests + doCheck = false; + + meta = with lib; { + description = "Generate dependency graphs of a given nix package"; + mainProgram = "nix-visualize"; + homepage = "https://github.com/craigmbooth/nix-visualize"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ henrirosten ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e82227fd83fd..1a5d2ae14f62 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -40061,6 +40061,8 @@ with pkgs; nix-simple-deploy = callPackage ../tools/package-management/nix-simple-deploy { }; + nix-visualize = python3.pkgs.callPackage ../tools/package-management/nix-visualize { }; + alejandra = callPackage ../tools/nix/alejandra { }; nixci = callPackage ../tools/nix/nixci {