-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefault.nix
92 lines (83 loc) · 1.85 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{
lib,
python3,
fetchFromGitLab,
# Test dependencies
openldap,
# Custom python dependencies
flask-themer,
flask-webtest,
slapd,
smtpdfix,
}:
python3.pkgs.buildPythonApplication rec {
pname = "canaille";
version = "0.0.29";
format = "pyproject";
src = fetchFromGitLab {
owner = "yaal";
repo = "canaille";
rev = "${version}";
sha256 = "sha256-987MFgIO1F9NLlZnAMIuORBvUAoKmy8RDM6cUdP9KYE=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace "poetry>=1.0.0" "poetry-core" \
--replace "poetry.masonry.api" "poetry.core.masonry.api"
'';
nativeBuildInputs = with python3.pkgs; [
poetry-core
babel
];
nativeCheckInputs = with python3.pkgs; [
coverage
faker
flask-webtest
freezegun
mock
openldap
pytest
pytest-cov
pytest-flask
pytest-httpserver
pytest-lazy-fixture
pytest-xdist
pytestCheckHook
pyquery
slapd
smtpdfix
];
propagatedBuildInputs = with python3.pkgs; [
authlib
click
email_validator
flask
flask-babel
flask-themer
flask_wtf
ldap
pycountry
sentry-sdk
toml
wtforms
];
# Excessively flakey tests: https://gitlab.com/yaal/canaille/-/issues/165
doCheck = false;
preCheck = ''
# Needed by tests to setup a mockup ldap server.
export BIN="${openldap}/bin"
export SBIN="${openldap}/bin"
export SLAPD="${openldap}/libexec/slapd"
export SCHEMA="${openldap}/etc/schema"
'';
postInstall = ''
mkdir -p $out/etc/schema
cp $out/lib/${python3.libPrefix}/site-packages/canaille/backends/ldap/schemas/* $out/etc/schema/
'';
meta = with lib; {
description = "Simplistic OpenID Connect provider over OpenLDAP";
homepage = "https://gitlab.com/yaal/canaille";
license = licenses.mit;
maintainers = with maintainers; [imsofi];
};
}