nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 85 lines 1.8 kB view raw
1{ 2 src, 3 version, 4 lib, 5 nixosTests, 6 fetchPypi, 7 python3, 8}: 9 10let 11 overrides = [ 12 (self: super: { 13 alembic = super.alembic.overridePythonAttrs (oldAttrs: rec { 14 version = "1.14.1"; 15 src = fetchPypi { 16 pname = "alembic"; 17 inherit version; 18 sha256 = "sha256-SW6IgkWlOt8UmPyrMXE6Rpxlg2+N524BOZqhw+kN0hM="; 19 }; 20 doCheck = false; 21 }); 22 23 pyheif = super.pyheif.overridePythonAttrs (oldAttrs: { 24 doCheck = false; 25 }); 26 27 sqlalchemy = super.sqlalchemy.overridePythonAttrs (oldAttrs: rec { 28 version = "1.3.23"; 29 src = fetchPypi { 30 pname = "SQLAlchemy"; 31 inherit version; 32 sha256 = "sha256-b8ozZyV4Zm9lfBMVUsTviXnBYG5JT3jNUZl0LfsmkYs="; 33 }; 34 35 doCheck = false; 36 }); 37 }) 38 ]; 39 40 python = python3.override { 41 self = python; 42 packageOverrides = lib.composeManyExtensions overrides; 43 }; 44in 45 46python.pkgs.buildPythonApplication { 47 pname = "szurubooru-server"; 48 inherit version; 49 pyproject = true; 50 51 src = "${src}/server"; 52 53 nativeBuildInputs = with python.pkgs; [ setuptools ]; 54 propagatedBuildInputs = with python.pkgs; [ 55 alembic 56 certifi 57 coloredlogs 58 heif-image-plugin 59 numpy 60 pillow-avif-plugin 61 pillow 62 psycopg2-binary 63 pyheif 64 pynacl 65 pyrfc3339 66 pytz 67 pyyaml 68 sqlalchemy 69 yt-dlp 70 ]; 71 72 postInstall = '' 73 mkdir $out/bin 74 install -m0755 $src/szuru-admin $out/bin/szuru-admin 75 ''; 76 77 passthru.tests.szurubooru = nixosTests.szurubooru; 78 79 meta = with lib; { 80 description = "Server of szurubooru, an image board engine for small and medium communities"; 81 homepage = "https://github.com/rr-/szurubooru"; 82 license = licenses.gpl3; 83 maintainers = with maintainers; [ ratcornu ]; 84 }; 85}