Merge pull request #237404 from cab404/cab/moonraker-gpiod

moonraker: add useGpiod
This commit is contained in:
Cabia Rangris 2023-10-02 06:45:16 +04:00 committed by GitHub
commit 6f7933059d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 19 deletions

View File

@ -1,8 +1,8 @@
{ config, lib, options, pkgs, ... }:
with lib;
let
pkg = pkgs.moonraker;
cfg = config.services.moonraker;
pkg = cfg.package;
opt = options.services.moonraker;
format = pkgs.formats.ini {
# https://github.com/NixOS/nixpkgs/pull/121613#issuecomment-885241996
@ -18,6 +18,14 @@ in {
services.moonraker = {
enable = mkEnableOption (lib.mdDoc "Moonraker, an API web server for Klipper");
package = mkOption {
type = with types; nullOr package;
default = pkgs.moonraker;
defaultText = literalExpression "pkgs.moonraker";
example = literalExpression "pkgs.moonraker.override { useGpiod = true; }";
description = lib.mdDoc "Moonraker package to use";
};
klipperSocket = mkOption {
type = types.path;
default = config.services.klipper.apiSocket;

View File

@ -1,23 +1,26 @@
{ lib, stdenvNoCC, fetchFromGitHub, python3, makeWrapper, unstableGitUpdater, nixosTests }:
{ 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
]);
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 ])
);
in stdenvNoCC.mkDerivation rec {
pname = "moonraker";
version = "unstable-2023-08-03";