nixpkgs/pkgs/servers/moonraker/default.nix

46 lines
1.1 KiB
Nix
Raw Normal View History

2021-07-21 04:21:02 +02:00
{ lib, stdenvNoCC, fetchFromGitHub, python3, makeWrapper, unstableGitUpdater }:
let
pythonEnv = python3.withPackages (packages: with packages; [
tornado
pyserial
pillow
lmdb
streaming-form-data
distro
inotify-simple
libnacl
paho-mqtt
pycurl
2021-07-21 04:21:02 +02:00
]);
in stdenvNoCC.mkDerivation rec {
pname = "moonraker";
version = "unstable-2021-11-13";
2021-07-21 04:21:02 +02:00
src = fetchFromGitHub {
owner = "Arksine";
repo = "moonraker";
rev = "bed239c90a3b5fef5c6bf4559a774b9d09987c30";
sha256 = "2gnW6dPsKMfoZnjs9F3opxRCeym+P43ZJOmGM44twfw=";
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"
'';
passthru.updateScript = unstableGitUpdater { url = meta.homepage; };
meta = with lib; {
description = "API web server for Klipper";
homepage = "https://github.com/Arksine/moonraker";
license = licenses.gpl3Only;
maintainers = with maintainers; [ zhaofengli ];
};
}