usbrelay: 1.0 -> 1.0.1

Changed files
+11 -7
nixos
modules
services
hardware
pkgs
os-specific
-4
nixos/modules/services/hardware/usbrelayd.nix
···
services.udev.packages = [ pkgs.usbrelayd ];
systemd.packages = [ pkgs.usbrelayd ];
-
users.users.usbrelay = {
-
isSystemUser = true;
-
group = "usbrelay";
-
};
users.groups.usbrelay = { };
};
+4 -1
pkgs/os-specific/linux/usbrelay/daemon.nix
···
-
{ stdenv, usbrelay, python3 }:
+
{ stdenv, usbrelay, python3, installShellFiles }:
let
python = python3.withPackages (ps: with ps; [ usbrelay-py paho-mqtt ]);
in
···
--replace '/usr/sbin/usbrelayd' "$out/bin/usbrelayd"
'';
+
nativeBuildInputs = [ installShellFiles ];
+
buildInputs = [ python ];
dontBuild = true;
···
install -m 644 -D usbrelayd.service $out/lib/systemd/system/usbrelayd.service
install -m 644 -D 50-usbrelay.rules $out/lib/udev/rules.d/50-usbrelay.rules
install -m 644 -D usbrelayd.conf $out/etc/usbrelayd.conf # include this as an example
+
installManPage usbrelayd.8
runHook postInstall
'';
+2 -2
pkgs/os-specific/linux/usbrelay/default.nix
···
{ stdenv, lib, fetchFromGitHub, hidapi, installShellFiles }:
stdenv.mkDerivation rec {
pname = "usbrelay";
-
version = "1.0";
+
version = "1.0.1";
src = fetchFromGitHub {
owner = "darrylb123";
repo = "usbrelay";
rev = version;
-
sha256 = "sha256-5zgpN4a+r0tmw0ISTJM+d9mo+L/qwUvpWPSsykuG0cg=";
+
sha256 = "sha256-2elDrO+WaaRYdTrG40Ez00qSsNVQjXE6GdOJbWPfugE=";
};
nativeBuildInputs = [
+4
pkgs/os-specific/linux/usbrelay/python.nix
···
pname = "usbrelay_py";
inherit (usbrelay) version src;
+
preConfigure = ''
+
cd usbrelay_py
+
'';
+
buildInputs = [ usbrelay ];
pythonImportsCheck = [ "usbrelay_py" ];
+1
pkgs/os-specific/linux/usbrelay/test.nix
···
};
testScript = ''
+
import os
if os.waitstatus_to_exitcode(os.system("lsusb -d 16c0:05df")) != 0:
print("No USB relay detected, skipping test")
import sys