2021-08-18 20:09:12 +01:00
|
|
|
{ lib, stdenv, python3, fetchPypi }:
|
|
|
|
|
|
|
|
let
|
|
|
|
defaultOverrides = [
|
|
|
|
(self: super: {
|
|
|
|
flask = super.flask.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "1.1.2";
|
|
|
|
pname = "Flask";
|
|
|
|
|
|
|
|
src = super.fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "sha256-Tvoa4tfJhlr0iYbeiuuFBL8yx/PW/ck1PTSyH0sScGA=";
|
|
|
|
};
|
|
|
|
|
|
|
|
checkInputs = [ self.pytest ];
|
|
|
|
propagatedBuildInputs = with self; [ itsdangerous click werkzeug jinja2 ];
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
|
|
|
(self: super: {
|
|
|
|
flask_login = super.flask_login.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
pname = "Flask";
|
|
|
|
version = "0.5.0";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "6d33aef15b5bcead780acc339464aae8a6e28f13c90d8b1cf9de8b549d1c0b4b";
|
|
|
|
};
|
|
|
|
doCheck = false;
|
|
|
|
});
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
mkOverride = attrname: version: sha256:
|
|
|
|
self: super: {
|
|
|
|
${attrname} = super.${attrname}.overridePythonAttrs (oldAttrs: {
|
|
|
|
inherit version;
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version sha256;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
py = python3.override {
|
|
|
|
# Put packageOverrides at the start so they are applied after defaultOverrides
|
|
|
|
packageOverrides = lib.foldr lib.composeExtensions (self: super: { }) (defaultOverrides);
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
with py.pkgs;
|
2020-11-14 15:24:32 +00:00
|
|
|
|
2021-03-19 07:49:30 +00:00
|
|
|
buildPythonApplication rec {
|
2020-11-14 15:24:32 +00:00
|
|
|
pname = "archivy";
|
2021-12-16 21:26:39 +00:00
|
|
|
version = "1.6.1";
|
2020-11-14 15:24:32 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-12-16 21:26:39 +00:00
|
|
|
sha256 = "sha256-nwpH3V6hkPC8G3df+0hTZqvIbvT1Z796uOI/iKnXS1w=";
|
2020-11-14 15:24:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Relax some dependencies
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace requirements.txt \
|
|
|
|
--replace 'WTForms ==' 'WTForms >=' \
|
|
|
|
--replace 'attrs == 20.2.0' 'attrs' \
|
2020-12-15 15:21:51 +00:00
|
|
|
--replace 'elasticsearch ==' 'elasticsearch >=' \
|
|
|
|
--replace 'python_dotenv ==' 'python_dotenv >=' \
|
2020-11-14 15:24:32 +00:00
|
|
|
--replace 'python_frontmatter == 0.5.0' 'python_frontmatter' \
|
2020-12-15 15:21:51 +00:00
|
|
|
--replace 'requests ==' 'requests >=' \
|
|
|
|
--replace 'validators ==' 'validators >=' \
|
2021-07-15 18:54:27 +01:00
|
|
|
--replace 'tinydb ==' 'tinydb >=' \
|
|
|
|
--replace 'Flask_WTF == 0.14.3' 'Flask_WTF' \
|
2021-08-18 20:09:12 +01:00
|
|
|
--replace 'Werkzeug ==' 'Werkzeug >='
|
2020-11-14 15:24:32 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
appdirs
|
|
|
|
attrs
|
|
|
|
beautifulsoup4
|
|
|
|
click-plugins
|
|
|
|
elasticsearch
|
2021-03-19 07:49:30 +00:00
|
|
|
flask-compress
|
2020-11-14 15:24:32 +00:00
|
|
|
flask_login
|
|
|
|
flask_wtf
|
2021-03-19 07:49:30 +00:00
|
|
|
html2text
|
2020-11-14 15:24:32 +00:00
|
|
|
python-dotenv
|
|
|
|
python-frontmatter
|
|
|
|
requests
|
2021-08-18 20:09:12 +01:00
|
|
|
setuptools
|
2021-03-19 07:49:30 +00:00
|
|
|
tinydb
|
2020-11-14 15:24:32 +00:00
|
|
|
validators
|
2021-03-19 07:49:30 +00:00
|
|
|
werkzeug
|
2020-11-14 15:24:32 +00:00
|
|
|
wtforms
|
|
|
|
];
|
|
|
|
|
|
|
|
# __init__.py attempts to mkdir in read-only file system
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-11-14 15:24:32 +00:00
|
|
|
description = "Self-hosted knowledge repository";
|
|
|
|
homepage = "https://archivy.github.io";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ siraben ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|