-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdefault.nix
42 lines (39 loc) · 991 Bytes
/
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
{
python3Packages,
callPackage,
extraPythonPackages ? [],
bannerDir ? null,
}:
let
issStatic = (callPackage ./src/statics {});
in
python3Packages.buildPythonPackage {
name = "ISS";
src = ./.;
format = "pyproject";
nativeBuildInputs = with python3Packages; [
build
setuptools
issStatic
];
propagatedBuildInputs = with python3Packages; [
django
pytz
pillow
psycopg2
lxml
requests
(pkgs.callPackage ./nix-deps/django-recaptcha2 {})
(pkgs.callPackage ./nix-deps/email-normalize {})
(pkgs.callPackage ./nix-deps/bbcode {})
(pkgs.callPackage ./nix-deps/tripphrase {})
] ++ extraPythonPackages;
preBuild = ''
declare BANNER_DIR="${if isNull bannerDir then "" else bannerDir}"
if [ -n "$BANNER_DIR" ]; then
mkdir -p ./src/ISS/static/banners
cp -r $BANNER_DIR/* ./src/ISS/static/banners
fi
cp -r --remove-destination ${issStatic}/lib/node_modules/iss-static/dist/* ./src/ISS/static
'';
}