2022-03-22 23:35:39 +01:00
|
|
|
{ lib, stdenvNoCC, fetchFromGitHub, python3, makeWrapper, unstableGitUpdater, nixosTests }:
|
2021-07-21 04:21:02 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
pythonEnv = python3.withPackages (packages: with packages; [
|
|
|
|
tornado
|
2022-03-22 23:35:38 +01:00
|
|
|
pyserial-asyncio
|
2021-07-21 04:21:02 +02:00
|
|
|
pillow
|
|
|
|
lmdb
|
|
|
|
streaming-form-data
|
|
|
|
distro
|
|
|
|
inotify-simple
|
|
|
|
libnacl
|
|
|
|
paho-mqtt
|
2021-10-05 14:05:16 +02:00
|
|
|
pycurl
|
2022-03-22 23:35:38 +01:00
|
|
|
zeroconf
|
|
|
|
preprocess-cancellation
|
|
|
|
jinja2
|
|
|
|
dbus-next
|
|
|
|
apprise
|
2021-07-21 04:21:02 +02:00
|
|
|
]);
|
|
|
|
in stdenvNoCC.mkDerivation rec {
|
|
|
|
pname = "moonraker";
|
2022-11-19 21:37:01 +01:00
|
|
|
version = "unstable-2022-11-18";
|
2021-07-21 04:21:02 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Arksine";
|
|
|
|
repo = "moonraker";
|
2022-11-19 21:37:01 +01:00
|
|
|
rev = "362bc1a3d3ad397416f7fc48b8efe33837428b90";
|
|
|
|
sha256 = "sha256-cebRHOx2hg470jM1CoQAk13Whv+KN2qx97BTlpjxSZg=";
|
2021-07-21 04:21:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out $out/bin $out/lib
|
|
|
|
cp -r moonraker $out/lib
|
|
|
|
|
|
|
|
makeWrapper ${pythonEnv}/bin/python $out/bin/moonraker \
|
|
|
|
--add-flags "$out/lib/moonraker/moonraker.py"
|
|
|
|
'';
|
|
|
|
|
2022-03-22 23:35:39 +01:00
|
|
|
passthru = {
|
|
|
|
updateScript = unstableGitUpdater { url = meta.homepage; };
|
|
|
|
tests.moonraker = nixosTests.moonraker;
|
|
|
|
};
|
2021-07-21 04:21:02 +02:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "API web server for Klipper";
|
|
|
|
homepage = "https://github.com/Arksine/moonraker";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ zhaofengli ];
|
|
|
|
};
|
|
|
|
}
|