flake.nix 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. {
  2. description = "A flake for building get";
  3. inputs = {
  4. nixpkgs.url = github:nixos/nixpkgs/nixos-unstable;
  5. flake-utils.url = github:numtide/flake-utils;
  6. nur.url = github:nix-community/NUR;
  7. };
  8. outputs = { self, nixpkgs, flake-utils, nur }:
  9. flake-utils.lib.eachDefaultSystem (system:
  10. let
  11. pkgs = nixpkgs.legacyPackages.${system};
  12. arklog = pkgs.python3Packages.buildPythonPackage rec {
  13. pname = "arklog";
  14. version = "0.5.1";
  15. format = "pyproject";
  16. src = pkgs.python3Packages.fetchPypi {
  17. inherit pname version;
  18. sha256 = "334059a336e400cafbc9a1c382e747bee2c7660115c2d0612aa725beb845acd4";
  19. };
  20. propagatedBuildInputs = with pkgs.python3Packages; [
  21. setuptools
  22. flit-core
  23. toml
  24. pyaml
  25. ];
  26. doCheck = false;
  27. meta = {
  28. homepage = "https://git.rys.one/arrys/arklog";
  29. description = "Custom python logging formatter with color output.";
  30. };
  31. };
  32. owly = pkgs.python3Packages.buildPythonPackage rec {
  33. pname = "owly";
  34. version = "0.0.3";
  35. format = "pyproject";
  36. src = pkgs.python3Packages.fetchPypi {
  37. inherit pname version;
  38. sha256 = "e412c67c0c19c419fa630eb6d123f397d1d3eebd9bd5c8820cd0b52144bb94f3";
  39. };
  40. propagatedBuildInputs = with pkgs.python3Packages; [
  41. setuptools
  42. flit-core
  43. toml
  44. pyaml
  45. ];
  46. doCheck = false;
  47. meta = {
  48. homepage = "https://git.rys.one/arrys/owly-lib";
  49. description = "SPARQL helper.";
  50. };
  51. };
  52. dearpygui = pkgs.python3Packages.buildPythonPackage rec {
  53. pname = "dearpygui";
  54. version = "1.9.1";
  55. src = pkgs.fetchFromGitHub {
  56. owner = "hoffstadt";
  57. repo = "DearPyGui";
  58. rev = "v${version}";
  59. fetchSubmodules = true;
  60. hash = "sha256-Af1jhQYT0CYNFMWihAtP6jRNYKm3XKEu3brFOPSGCnk=";
  61. };
  62. cmakeFlags = [ "-DMVDIST_ONLY=True" ];
  63. postConfigure = ''
  64. cd $cmakeDir
  65. mv build cmake-build-local
  66. '';
  67. nativeBuildInputs = [ pkgs.pkg-config pkgs.cmake ];
  68. buildInputs = [
  69. pkgs.libxcrypt
  70. pkgs.xorg.libX11.dev
  71. pkgs.xorg.libXrandr.dev
  72. pkgs.xorg.libXinerama.dev
  73. pkgs.xorg.libXcursor.dev
  74. pkgs.xorg.xinput
  75. pkgs.xorg.libXi.dev
  76. pkgs.xorg.libXext
  77. # are in submodules but well cmake and setuptools are hell of a couple
  78. pkgs.glfw
  79. pkgs.glew
  80. ];
  81. dontUseSetuptoolsCheck = true;
  82. pythonImportsCheck = [
  83. "dearpygui"
  84. ];
  85. meta = {
  86. #maintainers = [ lib.maintainers.SomeoneSerge ];
  87. #license = lib.licenses.mit;
  88. description = ''
  89. Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies
  90. '';
  91. homepage = "https://dearpygui.readthedocs.io/en/";
  92. #broken = stdenv.isDarwin;
  93. #platforms = lib.platforms.unix;
  94. };};
  95. in {
  96. packages = rec {
  97. get = pkgs.python3Packages.buildPythonPackage {
  98. pname = "graph-exploring-tool";
  99. version = "0.2.4";
  100. format = "pyproject";
  101. src = ./.;
  102. nativeBuildInputs = [];
  103. propagatedBuildInputs = with pkgs.python3Packages; [
  104. #setuptools
  105. flit-core
  106. toml
  107. arklog
  108. rdflib
  109. dacite
  110. owly
  111. certifi
  112. dearpygui
  113. ];
  114. # checkInputs = with pkgs.python3Packages; [
  115. # pytest
  116. # sparqlwrapper
  117. # ];
  118. # buildInputs = with pkgs.python3Packages; [
  119. # sphinx
  120. # tox
  121. # pip
  122. # flit
  123. # twine
  124. # numpy
  125. # invoke
  126. # jinja2
  127. # flake8
  128. # coverage
  129. # ];
  130. };
  131. # https://discourse.nixos.org/t/basic-flake-run-existing-python-bash-script/19886/2
  132. server = let python = pkgs.python3.withPackages (ps: with ps; [ get ]); in pkgs.writeScriptBin "run-python" ''
  133. ${python}/bin/python -m graph_exploring_tool
  134. '';
  135. launchScript = let python = pkgs.python3.withPackages (ps: with ps; [ get ]); in pkgs.writeTextFile {
  136. name = "run.sh";
  137. text = ''${python}/bin/python -m graph_exploring_tool'';
  138. executable = true;
  139. };
  140. default = get;
  141. };
  142. apps = rec {
  143. # App that starts when invoking `nix run .#graph-exploring-tool`
  144. get = {
  145. type = "app";
  146. program = "${self.packages.${system}.launchScript}";
  147. };
  148. # App that starts when invoking `nix run .`
  149. default=get;
  150. };
  151. });
  152. nixConfig.bash-prompt-prefix = "\\e\[94;1m[graph-exploring-tool]\\e\[m ";
  153. }