nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (1267B)


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