nixpkgs/pkgs/by-name/mo/moonraker/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

62 lines
1.4 KiB
Nix

{ lib, stdenvNoCC, fetchFromGitHub, python3, makeWrapper, unstableGitUpdater, nixosTests, useGpiod ? false }:
let
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
python-periphery
ldap3
]
);
in stdenvNoCC.mkDerivation rec {
pname = "moonraker";
version = "0.8.0-unstable-2023-12-27";
src = fetchFromGitHub {
owner = "Arksine";
repo = "moonraker";
rev = "c226e9c1e44d65ff6ea400b81e3cedba7f637976";
sha256 = "sha256-wdf4uab8pJEWaX6PFN9Y9pykmylmxJ4Oo5pwSQcyjCc=";
};
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;
tagPrefix = "v";
};
tests.moonraker = nixosTests.moonraker;
};
meta = with lib; {
description = "API web server for Klipper";
homepage = "https://github.com/Arksine/moonraker";
license = licenses.gpl3Only;
maintainers = with maintainers; [ zhaofengli ];
mainProgram = "moonraker";
};
}