mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
spoolman: init at 0.22.1
This commit is contained in:
parent
63d660c0cb
commit
c649478ee9
6 changed files with 205 additions and 0 deletions
25
pkgs/by-name/sp/spoolman/common.nix
Normal file
25
pkgs/by-name/sp/spoolman/common.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ lib, fetchFromGitHub }:
|
||||
let
|
||||
version = "0.22.1";
|
||||
in
|
||||
{
|
||||
inherit version;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Donkie";
|
||||
repo = "Spoolman";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-EVGpwcjEh4u8Vtgu2LypqMqArYLZe7oh1qYhGZpgjh0=";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Keep track of your inventory of 3D-printer filament spools";
|
||||
homepage = "https://github.com/Donkie/Spoolman";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [
|
||||
MayNiklas
|
||||
pinpox
|
||||
];
|
||||
mainProgram = "spoolman";
|
||||
};
|
||||
}
|
23
pkgs/by-name/sp/spoolman/frontend.nix
Normal file
23
pkgs/by-name/sp/spoolman/frontend.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ buildNpmPackage, callPackage }:
|
||||
let
|
||||
common = callPackage ./common.nix { };
|
||||
in
|
||||
|
||||
buildNpmPackage {
|
||||
pname = "spoolman-frontend";
|
||||
|
||||
inherit (common) version;
|
||||
|
||||
src = "${common.src}/client";
|
||||
|
||||
npmDepsHash = "sha256-E4DvEOSHfwwM0C+vTRMDQbCNv2IDyFOFwfqszrI+uOA=";
|
||||
|
||||
VITE_APIURL = "/api/v1";
|
||||
|
||||
installPhase = "cp -r dist $out";
|
||||
|
||||
meta = common.meta // {
|
||||
description = "Spoolman frontend";
|
||||
mainProgram = "spoolman-frontend";
|
||||
};
|
||||
}
|
79
pkgs/by-name/sp/spoolman/package.nix
Normal file
79
pkgs/by-name/sp/spoolman/package.nix
Normal file
|
@ -0,0 +1,79 @@
|
|||
{
|
||||
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";
|
||||
};
|
||||
}
|
37
pkgs/development/python-modules/scheduler/default.nix
Normal file
37
pkgs/development/python-modules/scheduler/default.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchPypi,
|
||||
setuptools,
|
||||
wheel,
|
||||
typeguard,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "scheduler";
|
||||
version = "0.8.5";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
hash = "sha256-8t1AUbD6cpETSoqoY88bSZmj7FuaF6c+7kJDJX2Lp4k=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
setuptools
|
||||
wheel
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
typeguard
|
||||
];
|
||||
|
||||
pythonImportsCheck = [ "scheduler" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "A simple in-process python scheduler library with asyncio, threading and timezone support. Use datetime standard library objects for planning of Jobs depending on time cycles, fixed times, weekdays, dates, weights, offsets and execution counts";
|
||||
homepage = "https://pypi.org/project/scheduler/";
|
||||
license = licenses.lgpl3;
|
||||
maintainers = with maintainers; [ pinpox ];
|
||||
};
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchPypi,
|
||||
setuptools,
|
||||
wheel,
|
||||
sqlalchemy,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "sqlalchemy-cockroachdb";
|
||||
version = "2.0.2";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
hash = "sha256-EZdW65BYVdahE0W5nP6FMDGj/lmKnEvzWo3ayfif6Mw=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
setuptools
|
||||
wheel
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
sqlalchemy
|
||||
];
|
||||
|
||||
pythonImportsCheck = [ "sqlalchemy_cockroachdb" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "CockroachDB dialect for SQLAlchemy";
|
||||
homepage = "https://pypi.org/project/sqlalchemy-cockroachdb";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ pinpox ];
|
||||
};
|
||||
}
|
|
@ -15519,6 +15519,8 @@ self: super: with self; {
|
|||
|
||||
schedule = callPackage ../development/python-modules/schedule { };
|
||||
|
||||
scheduler = callPackage ../development/python-modules/scheduler { };
|
||||
|
||||
schema = callPackage ../development/python-modules/schema { };
|
||||
|
||||
schema-salad = callPackage ../development/python-modules/schema-salad { };
|
||||
|
@ -16548,6 +16550,8 @@ self: super: with self; {
|
|||
|
||||
sqlalchemy-citext = callPackage ../development/python-modules/sqlalchemy-citext { };
|
||||
|
||||
sqlalchemy-cockroachdb = callPackage ../development/python-modules/sqlalchemy-cockroachdb { };
|
||||
|
||||
sqlalchemy-continuum = callPackage ../development/python-modules/sqlalchemy-continuum { };
|
||||
|
||||
sqlalchemy-file = callPackage ../development/python-modules/sqlalchemy-file { };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue