summaryrefslogtreecommitdiffstats
path: root/makefu/5pkgs/HermesLedControl/default.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2023-01-14 14:38:41 +0100
committermakefu <github@syntax-fehler.de>2023-01-14 14:38:41 +0100
commit1c27953bdd2e56c90ac98b711154c2e8c45269df (patch)
tree64a9781d3018f6189e2e14ef5ff602a230c9a64e /makefu/5pkgs/HermesLedControl/default.nix
parentac4728cd2a3fea04b1822dde50413ebb1fd4f124 (diff)
ma pkgs.HermesLedControl: init at 3.0.4
Diffstat (limited to 'makefu/5pkgs/HermesLedControl/default.nix')
-rw-r--r--makefu/5pkgs/HermesLedControl/default.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/makefu/5pkgs/HermesLedControl/default.nix b/makefu/5pkgs/HermesLedControl/default.nix
new file mode 100644
index 000000000..88aed898d
--- /dev/null
+++ b/makefu/5pkgs/HermesLedControl/default.nix
@@ -0,0 +1,54 @@
+{ lib, pkgs, python3Packages, makeWrapper, ... }:
+
+# How to use:
+# create configuration .config/HermesLedControl/configuration.yml:
+# engine: "rhasspy"
+# pathToConfig: "/var/lib/rhasspy/de/profile.json"
+# hardware: "respeaker4MicArray"
+# pattern: "fake-name"
+# enableDoA: false
+
+
+with python3Packages; buildPythonApplication rec {
+ name = "HermesLedControl-${version}";
+ format = "other";
+ version = "3.0.4";
+
+ src = pkgs.fetchFromGitHub {
+ owner = "project-alice-assistant";
+ repo = "HermesLedControl";
+ rev = "v${version}";
+ hash = "sha256-fVbTQPSo3fNjLb8PDDDqhMC9Hez01rTH46cKz/mfwoU=";
+ };
+
+ patches = [
+ ./remove-logger.patch
+ ];
+
+ execWrapper = ''
+ #!/bin/sh
+ cd $out/lib/HermesLedControl && \
+ PYTHONPATH="${makePythonPath propagatedBuildInputs}" exec \
+ ${python}/bin/python "$out/lib/HermesLedControl/main.py" "$@"
+ '';
+
+ installPhase = ''
+ install -d "$out/lib/"
+ install -d "$out/bin"
+ cp -r . $out/lib/HermesLedControl
+
+ echo "${execWrapper}" > HermesLedControl
+ install -Dm755 HermesLedControl $out/bin/HermesLedControl
+
+ '';
+
+ propagatedBuildInputs = [
+ spidev gpiozero rpi-gpio pyyaml paho-mqtt types-pyyaml makeWrapper
+ ];
+
+ meta = {
+ homepage = "https://github.com/project-alice-assistant/HermesLedControl";
+ description = "Provides an easy way to control your leds in an Hermes environment";
+ license = lib.licenses.gpl3;
+ };
+}