Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
80 lines
1.6 KiB
Nix
80 lines
1.6 KiB
Nix
{
|
|
python312,
|
|
lib,
|
|
callPackage,
|
|
writeShellScript,
|
|
makeWrapper,
|
|
}:
|
|
|
|
let
|
|
common = callPackage ./common.nix { };
|
|
frontend = callPackage ./frontend.nix { };
|
|
python = python312;
|
|
in
|
|
|
|
python.pkgs.buildPythonPackage rec {
|
|
|
|
pname = "spoolman";
|
|
inherit (common) version src;
|
|
|
|
pyproject = true;
|
|
|
|
nativeBuildInputs = [
|
|
makeWrapper
|
|
python.pkgs.pdm-backend
|
|
python.pkgs.pythonRelaxDepsHook
|
|
];
|
|
|
|
pythonRelaxDeps = [ "setuptools" ];
|
|
|
|
postPatch = ''
|
|
substituteInPlace pyproject.toml --replace-fail psycopg2-binary psycopg2
|
|
'';
|
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
|
uvloop
|
|
alembic
|
|
asyncpg
|
|
fastapi
|
|
hishel
|
|
httptools
|
|
httpx
|
|
aiosqlite
|
|
platformdirs
|
|
prometheus-client
|
|
psycopg2
|
|
pydantic
|
|
scheduler
|
|
setuptools
|
|
sqlalchemy
|
|
sqlalchemy-cockroachdb
|
|
uvicorn
|
|
websockets
|
|
];
|
|
|
|
pythonImportsCheck = [ "spoolman" ];
|
|
|
|
postInstall =
|
|
let
|
|
start_script = writeShellScript "start-spoolman" ''
|
|
${lib.getExe python.pkgs.uvicorn} "$@" spoolman.main:app;
|
|
'';
|
|
in
|
|
''
|
|
mkdir -p $out/runpath/client/dist $out/bin
|
|
cp -r $src/* $out/runpath
|
|
cp -r ${frontend}/* $out/runpath/client/dist
|
|
|
|
makeWrapper ${start_script} $out/bin/spoolman \
|
|
--chdir $out/runpath \
|
|
--prefix PYTHONPATH : "$out/${python.sitePackages}" \
|
|
--prefix PYTHONPATH : "${python.pkgs.makePythonPath propagatedBuildInputs}" \
|
|
--prefix PATH : "${python.pkgs.alembic}/bin"
|
|
'';
|
|
|
|
meta = common.meta // {
|
|
description = "Spoolman server";
|
|
mainProgram = "spoolman";
|
|
};
|
|
}
|