You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

core.nix 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. { stdenv, fetchgit, fetchNodeModules, buildPythonPackage
  2. , pgpy, flask, bleach, misaka, humanize, markdown, psycopg2, pygments, requests
  3. , sqlalchemy, flask_login, beautifulsoup4, sqlalchemy-utils, celery, alembic
  4. , sassc, nodejs
  5. , writeText }:
  6. buildPythonPackage rec {
  7. pname = "srht";
  8. version = "0.52.13";
  9. src = fetchgit {
  10. url = "https://git.sr.ht/~sircmpwn/core.sr.ht";
  11. rev = version;
  12. sha256 = "0i7gd2rkq4y4lffxsgb3mql9ddmk3vqckan29w266imrqs6p8c0z";
  13. };
  14. node_modules = fetchNodeModules {
  15. src = "${src}/srht";
  16. nodejs = nodejs;
  17. sha256 = "0axl50swhcw8llq8z2icwr4nkr5qsw2riih0a040f9wx4xiw4p6p";
  18. };
  19. patches = [
  20. ./disable-npm-install.patch
  21. ];
  22. nativeBuildInputs = [
  23. sassc
  24. nodejs
  25. ];
  26. propagatedBuildInputs = [
  27. pgpy
  28. flask
  29. bleach
  30. misaka
  31. humanize
  32. markdown
  33. psycopg2
  34. pygments
  35. requests
  36. sqlalchemy
  37. flask_login
  38. beautifulsoup4
  39. sqlalchemy-utils
  40. # Unofficial runtime dependencies?
  41. celery
  42. alembic
  43. ];
  44. PKGVER = version;
  45. preBuild = ''
  46. cp -r ${node_modules} srht/node_modules
  47. '';
  48. # No actual? tests but seems like it needs this anyway
  49. preCheck = let
  50. config = writeText "config.ini" ''
  51. [webhooks]
  52. private-key=K6JupPpnr0HnBjelKTQUSm3Ro9SgzEA2T2Zv472OvzI=
  53. [meta.sr.ht]
  54. origin=http://meta.sr.ht.local
  55. '';
  56. in ''
  57. # Validation needs config option(s)
  58. # webhooks <- ( private-key )
  59. # meta.sr.ht <- ( origin )
  60. cp ${config} config.ini
  61. '';
  62. meta = with stdenv.lib; {
  63. homepage = https://git.sr.ht/~sircmpwn/srht;
  64. description = "Core modules for sr.ht";
  65. license = licenses.bsd3;
  66. broken = true;
  67. maintainers = with maintainers; [ eadwu ];
  68. };
  69. }