2023-10-09 19:29:22 +00:00
|
|
|
{ lib, stdenvNoCC, fetchFromGitHub, python3, makeWrapper, unstableGitUpdater, nixosTests, useGpiod ? false }:
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
let
|
2023-10-09 19:29:22 +00:00
|
|
|
pythonEnv = python3.withPackages (packages:
|
|
|
|
with packages; [
|
|
|
|
tornado
|
|
|
|
pyserial-asyncio
|
|
|
|
pillow
|
|
|
|
lmdb
|
|
|
|
streaming-form-data
|
|
|
|
distro
|
|
|
|
inotify-simple
|
|
|
|
libnacl
|
|
|
|
paho-mqtt
|
|
|
|
pycurl
|
|
|
|
zeroconf
|
|
|
|
preprocess-cancellation
|
|
|
|
jinja2
|
|
|
|
dbus-next
|
|
|
|
apprise
|
|
|
|
]
|
|
|
|
++ (lib.optionals useGpiod [ libgpiod ])
|
|
|
|
);
|
2021-08-05 21:33:18 +00:00
|
|
|
in stdenvNoCC.mkDerivation rec {
|
|
|
|
pname = "moonraker";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "unstable-2023-12-16";
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Arksine";
|
|
|
|
repo = "moonraker";
|
2024-01-02 11:29:13 +00:00
|
|
|
rev = "42357891a3716cd332ef60b28af09f8732dbf67a";
|
|
|
|
sha256 = "sha256-5w336GaHUkbmhAPvhOO3kNW5q7qTFVw3p0Q+Rv+YdYM=";
|
2021-08-05 21:33:18 +00: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-30 09:31:56 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = unstableGitUpdater { url = meta.homepage; };
|
|
|
|
tests.moonraker = nixosTests.moonraker;
|
|
|
|
};
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "API web server for Klipper";
|
|
|
|
homepage = "https://github.com/Arksine/moonraker";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ zhaofengli ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "moonraker";
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
|
|
|
}
|