2023-01-11 07:51:40 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, withLdap ? true
|
2024-04-21 15:54:59 +00:00
|
|
|
, python3
|
2023-01-11 07:51:40 +00:00
|
|
|
, withPostgres ? true
|
2023-07-15 17:15:38 +00:00
|
|
|
, nix-update-script
|
2024-04-21 15:54:59 +00:00
|
|
|
, nixosTests
|
2023-01-11 07:51:40 +00:00
|
|
|
}:
|
2021-02-13 14:23:35 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
let
|
|
|
|
python = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
pydantic = super.pydantic_1;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
python.pkgs.buildPythonPackage rec {
|
2021-02-13 14:23:35 +00:00
|
|
|
pname = "etebase-server";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "0.13.1";
|
2021-02-13 14:23:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "etesync";
|
|
|
|
repo = "server";
|
2024-06-20 14:57:18 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-GEieXue3Kvc4zZjfypKLmTmhNPbn/GR8g0qEqkl+wkw=";
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./secret.patch ];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
2022-04-27 09:35:20 +00:00
|
|
|
aiofiles
|
2024-06-20 14:57:18 +00:00
|
|
|
django_4
|
2022-03-30 09:31:56 +00:00
|
|
|
fastapi
|
2021-02-13 14:23:35 +00:00
|
|
|
msgpack
|
|
|
|
pynacl
|
2022-10-30 15:09:59 +00:00
|
|
|
redis
|
2024-04-21 15:54:59 +00:00
|
|
|
uvicorn
|
|
|
|
websockets
|
|
|
|
watchfiles
|
|
|
|
uvloop
|
|
|
|
pyyaml
|
|
|
|
python-dotenv
|
|
|
|
httptools
|
2022-04-27 09:35:20 +00:00
|
|
|
typing-extensions
|
2023-02-16 17:41:37 +00:00
|
|
|
] ++ lib.optional withLdap python-ldap
|
|
|
|
++ lib.optional withPostgres psycopg2;
|
2021-02-13 14:23:35 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
postInstall = ''
|
2021-02-13 14:23:35 +00:00
|
|
|
mkdir -p $out/bin $out/lib
|
2024-04-21 15:54:59 +00:00
|
|
|
cp manage.py $out/bin/etebase-server
|
2021-02-13 14:23:35 +00:00
|
|
|
wrapProgram $out/bin/etebase-server --prefix PYTHONPATH : "$PYTHONPATH"
|
|
|
|
chmod +x $out/bin/etebase-server
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passthru.updateScript = nix-update-script {};
|
2024-04-21 15:54:59 +00:00
|
|
|
passthru.python = python;
|
|
|
|
# PYTHONPATH of all dependencies used by the package
|
|
|
|
passthru.pythonPath = python.pkgs.makePythonPath propagatedBuildInputs;
|
|
|
|
passthru.tests = {
|
|
|
|
nixosTest = nixosTests.etebase-server;
|
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/etesync/server";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Etebase (EteSync 2.0) server so you can run your own";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "etebase-server";
|
2023-01-11 07:51:40 +00:00
|
|
|
changelog = "https://github.com/etesync/server/blob/${version}/ChangeLog.md";
|
2021-02-13 14:23:35 +00:00
|
|
|
license = licenses.agpl3Only;
|
2024-04-21 15:54:59 +00:00
|
|
|
maintainers = with maintainers; [ felschr phaer ];
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
|
|
|
}
|