2023-01-04 12:41:25 +03:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, withLdap ? true
|
2024-01-24 00:43:49 +03:00
|
|
|
, python3
|
2023-01-04 12:41:25 +03:00
|
|
|
, withPostgres ? true
|
2023-05-14 00:56:30 +03:00
|
|
|
, nix-update-script
|
2024-01-24 00:43:49 +03:00
|
|
|
, nixosTests
|
2023-01-04 12:41:25 +03:00
|
|
|
}:
|
2020-11-28 01:12:41 +03:00
|
|
|
|
2024-01-24 00:43:49 +03:00
|
|
|
let
|
|
|
|
python = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
pydantic = super.pydantic_1;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
python.pkgs.buildPythonPackage rec {
|
2020-11-28 01:12:41 +03:00
|
|
|
pname = "etebase-server";
|
2023-01-03 23:27:08 +03:00
|
|
|
version = "0.11.0";
|
2020-11-28 01:12:41 +03:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "etesync";
|
|
|
|
repo = "server";
|
2023-01-04 12:41:25 +03:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-+MSNX+CFmIQII+SFjM2TQKCgRMOTdsOIVAP8ur4WjQY=";
|
2020-11-28 01:12:41 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./secret.patch ];
|
|
|
|
|
2024-03-02 00:55:27 +03:00
|
|
|
doCheck = false;
|
|
|
|
|
2024-03-02 00:54:41 +03:00
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
2022-04-28 00:12:01 +03:00
|
|
|
aiofiles
|
|
|
|
django_3
|
2022-03-28 21:29:41 +03:00
|
|
|
fastapi
|
2020-11-28 01:12:41 +03:00
|
|
|
msgpack
|
|
|
|
pynacl
|
2022-10-15 18:32:49 +03:00
|
|
|
redis
|
2024-03-02 00:54:41 +03:00
|
|
|
uvicorn
|
|
|
|
websockets
|
|
|
|
watchfiles
|
|
|
|
uvloop
|
|
|
|
pyyaml
|
|
|
|
python-dotenv
|
|
|
|
httptools
|
2022-04-28 00:12:01 +03:00
|
|
|
typing-extensions
|
2023-02-04 15:42:28 +03:00
|
|
|
] ++ lib.optional withLdap python-ldap
|
|
|
|
++ lib.optional withPostgres psycopg2;
|
2020-11-28 01:12:41 +03:00
|
|
|
|
2024-03-02 00:55:27 +03:00
|
|
|
postInstall = ''
|
2020-11-28 01:12:41 +03:00
|
|
|
mkdir -p $out/bin $out/lib
|
2024-03-02 00:55:27 +03:00
|
|
|
cp manage.py $out/bin/etebase-server
|
2020-11-28 01:12:41 +03:00
|
|
|
wrapProgram $out/bin/etebase-server --prefix PYTHONPATH : "$PYTHONPATH"
|
|
|
|
chmod +x $out/bin/etebase-server
|
|
|
|
'';
|
|
|
|
|
2023-05-14 00:56:30 +03:00
|
|
|
passthru.updateScript = nix-update-script {};
|
2024-03-02 00:55:27 +03:00
|
|
|
passthru.python = python;
|
|
|
|
# PYTHONPATH of all dependencies used by the package
|
|
|
|
passthru.pythonPath = python.pkgs.makePythonPath propagatedBuildInputs;
|
2024-01-24 00:43:49 +03:00
|
|
|
passthru.tests = {
|
|
|
|
nixosTest = nixosTests.etebase-server;
|
|
|
|
};
|
2023-05-14 00:56:30 +03:00
|
|
|
|
2020-11-28 01:12:41 +03:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/etesync/server";
|
2023-01-04 12:41:25 +03:00
|
|
|
description = "An Etebase (EteSync 2.0) server so you can run your own";
|
2024-03-19 05:14:51 +03:00
|
|
|
mainProgram = "etebase-server";
|
2023-01-04 12:41:25 +03:00
|
|
|
changelog = "https://github.com/etesync/server/blob/${version}/ChangeLog.md";
|
2020-11-28 01:12:41 +03:00
|
|
|
license = licenses.agpl3Only;
|
2024-01-24 01:05:11 +03:00
|
|
|
maintainers = with maintainers; [ felschr phaer ];
|
2020-11-28 01:12:41 +03:00
|
|
|
};
|
|
|
|
}
|