Merge pull request #172080 from wentasah/usbrelay-1.0

usbrelay: 0.9 -> 1.0
This commit is contained in:
Sandro 2022-05-09 01:02:08 +02:00 committed by GitHub
commit b196dea22d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 6 deletions

View file

@ -26,8 +26,7 @@ in
config = mkIf cfg.enable {
# TODO: Rename to .conf in upcomming release
environment.etc."usbrelayd.ini".text = ''
environment.etc."usbrelayd.conf".text = ''
[MQTT]
BROKER = ${cfg.broker}
CLIENTNAME = ${cfg.clientName}
@ -41,4 +40,8 @@ in
};
users.groups.usbrelay = { };
};
meta = {
maintainers = with lib.maintainers; [ wentasah ];
};
}

View file

@ -25,9 +25,9 @@ stdenv.mkDerivation rec {
install -m 644 -D usbrelayd $out/bin/usbrelayd
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
runHook postInstall
'';
# TODO for later releases: install -D usbrelayd.conf $out/etc/usbrelayd.conf # include this as an example
meta = {
description = "USB Relay MQTT service";

View file

@ -1,15 +1,19 @@
{ stdenv, lib, fetchFromGitHub, hidapi }:
{ stdenv, lib, fetchFromGitHub, hidapi, installShellFiles }:
stdenv.mkDerivation rec {
pname = "usbrelay";
version = "0.9";
version = "1.0";
src = fetchFromGitHub {
owner = "darrylb123";
repo = "usbrelay";
rev = version;
sha256 = "sha256-bxME4r5W5bZKxMZ/Svi1EenqHKVWIjU6iiKaM8U6lmA=";
sha256 = "sha256-5zgpN4a+r0tmw0ISTJM+d9mo+L/qwUvpWPSsykuG0cg=";
};
nativeBuildInputs = [
installShellFiles
];
buildInputs = [
hidapi
];
@ -19,6 +23,10 @@ stdenv.mkDerivation rec {
"PREFIX=${placeholder "out"}"
];
postInstall = ''
installManPage usbrelay.1
'';
meta = with lib; {
description = "Tool to control USB HID relays";
homepage = "https://github.com/darrylb123/usbrelay";