default.nix (1188B)
1 { 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 writeText, 6 msgpack, 7 protobuf, 8 psycopg2, 9 }: 10 11 let 12 setupPy = writeText "setup.py" '' 13 from setuptools import setup 14 setup( 15 name='tracks_storage_server', 16 version='1.0', 17 install_requires=['msgpack', 'protobuf', 'psycopg2'], 18 py_modules=['server', 'nktk_raw_pb2', 'config'], 19 data_files=[('bin', ['init.sql'])], 20 scripts=['init_db.py'], 21 ) 22 ''; 23 in 24 buildPythonPackage { 25 pname = "tracks_storage_server"; 26 version = "2024-04-27"; 27 28 src = fetchFromGitHub { 29 owner = "wladich"; 30 repo = "tracks_storage_server"; 31 rev = "080526665a38c44e8c08e70d4ddcdda1c1911fc8"; 32 hash = "sha256-fN7OG52t2pHxFlCxhnMkVMpctsuwBQyuXMO9CD9eWLg="; 33 }; 34 35 postPatch = '' 36 cp ${setupPy} ${setupPy.name} 37 substitute config.py.example config.py --replace-fail "'password" "#'password" 38 ''; 39 40 dependencies = [ 41 msgpack 42 protobuf 43 psycopg2 44 ]; 45 46 pythonImportsCheck = [ "server" ]; 47 48 meta = { 49 description = "Tracks storage server"; 50 homepage = "https://github.com/wladich/tracks_storage_server"; 51 license = lib.licenses.free; 52 maintainers = [ lib.maintainers.sikmir ]; 53 }; 54 }