From 1827b73b35dc1b2c0187d968e3d0da07edcd10d7 Mon Sep 17 00:00:00 2001 From: Nick Bathum Date: Sat, 24 Oct 2020 09:37:38 -0400 Subject: [PATCH 1/3] maintainers: add addict3d --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 498fa758904..c8a81de9ccc 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -176,6 +176,12 @@ githubId = 1773511; name = "Adrien Devresse"; }; + addict3d = { + email = "nickbathum@gmail.com"; + github = "addict3d"; + githubId = 49227; + name = "Nick Bathum"; + }; adisbladis = { email = "adis@blad.is"; github = "adisbladis"; From e2d7984d8cae0f9be8ab147f9afc89022b866c27 Mon Sep 17 00:00:00 2001 From: Nick Bathum Date: Sat, 10 Apr 2021 13:03:54 -0400 Subject: [PATCH 2/3] round: init at v0.0.2 Round image corners from CLI. Used by python diagrams. --- pkgs/applications/graphics/round/default.nix | 27 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 pkgs/applications/graphics/round/default.nix diff --git a/pkgs/applications/graphics/round/default.nix b/pkgs/applications/graphics/round/default.nix new file mode 100644 index 00000000000..a34a52c4eee --- /dev/null +++ b/pkgs/applications/graphics/round/default.nix @@ -0,0 +1,27 @@ +{ lib +, buildGoModule +, fetchFromGitHub +}: + +buildGoModule rec { + pname = "round"; + version = "0.0.2"; + + src = fetchFromGitHub { + owner = "mingrammer"; + repo = pname; + rev = "v${version}"; + sha256 = "09brjr3h4qnhlidxlki1by5anahxy16ai078zm4k7ryl579amzdw"; + }; + + vendorSha256 = null; + + subPackages = [ "." ]; + + meta = with lib; { + description = "Round image corners from CLI"; + homepage = "https://github.com/mingrammer/round"; + license = licenses.mit; + maintainers = with maintainers; [ addict3d ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b2f08f229a3..9d8915a8fd4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15333,6 +15333,8 @@ in rote = callPackage ../development/libraries/rote { }; + round = callPackage ../applications/graphics/round { }; + ronn = callPackage ../development/tools/ronn { }; rshell = python3.pkgs.callPackage ../development/tools/rshell { }; From 5e5a40b1ee0ccd5f3cd7423dfcf2fb6aad265ca6 Mon Sep 17 00:00:00 2001 From: Nick Bathum Date: Sat, 10 Apr 2021 13:06:35 -0400 Subject: [PATCH 3/3] pythonPackages.diagrams: init at 0.19.1 Add python diagrams library. Generate nice architecture diagrams with python code, allowing for rapid iteration. The images are rendered using dot from graphviz. This PR is based on the upstream GitHub repo for diagrams, which differs significantly from the tarball published to pypi. Closes #101532 --- .../diagrams/build_poetry.patch | 12 +++++ .../python-modules/diagrams/default.nix | 49 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 63 insertions(+) create mode 100644 pkgs/development/python-modules/diagrams/build_poetry.patch create mode 100644 pkgs/development/python-modules/diagrams/default.nix diff --git a/pkgs/development/python-modules/diagrams/build_poetry.patch b/pkgs/development/python-modules/diagrams/build_poetry.patch new file mode 100644 index 00000000000..b2e3d39dae1 --- /dev/null +++ b/pkgs/development/python-modules/diagrams/build_poetry.patch @@ -0,0 +1,12 @@ +diff --git a/pyproject.toml b/pyproject.toml +index 2c93a39..6c800e2 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -24,3 +24,7 @@ isort = "^4.3" + + [tool.black] + line-length = 120 ++ ++[build-system] ++requires = ["poetry_core>=1.0.0"] ++build-backend = "poetry.core.masonry.api" diff --git a/pkgs/development/python-modules/diagrams/default.nix b/pkgs/development/python-modules/diagrams/default.nix new file mode 100644 index 00000000000..37e23d730e6 --- /dev/null +++ b/pkgs/development/python-modules/diagrams/default.nix @@ -0,0 +1,49 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, black +, jinja2 +, poetry-core +, round +, graphviz +, inkscape +, imagemagick +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "diagrams"; + version = "0.19.1"; + format = "pyproject"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "mingrammer"; + repo = pname; + rev = "v${version}"; + sha256 = "0qvk0cp3026n5jmwp9z7m70b6pws0h6a7slxr23glg18baxr44d4"; + }; + + preConfigure = '' + patchShebangs autogen.sh + ./autogen.sh + ''; + + patches = [ ./build_poetry.patch ]; + + checkInputs = [ pytestCheckHook ]; + + # Despite living in 'tool.poetry.dependencies', + # these are only used at build time to process the image resource files + nativeBuildInputs = [ black inkscape imagemagick jinja2 poetry-core round ]; + + propagatedBuildInputs = [ graphviz ]; + + meta = with lib; { + description = "Diagram as Code"; + homepage = "https://diagrams.mingrammer.com/"; + license = licenses.mit; + maintainers = with maintainers; [ addict3d ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 72b60ba902c..1177fa1e613 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1553,6 +1553,8 @@ in { dftfit = callPackage ../development/python-modules/dftfit { }; + diagrams = callPackage ../development/python-modules/diagrams { }; + diceware = callPackage ../development/python-modules/diceware { }; dicom2nifti = callPackage ../development/python-modules/dicom2nifti { };