Unverified Commit 35f9b4c1 authored by Martin Weinelt's avatar Martin Weinelt Committed by GitHub
Browse files

zigbee2mqtt_2: init at 2.1.1 (#371053)

parents d0755484 99eabc0a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -261,6 +261,8 @@

- `nodePackages."@commitlint/config-conventional"` has been removed, as it is a library, and projects should depend on it instead.

-  zigbee2mqtt is now available in version 2.x as `zigbee2mqtt_2`. In NixOS 25.11 we'll remove `zigbee2mqtt_1` and default to `zigbee2mqtt_2`. See the [breaking changes](https://github.com/Koenkk/zigbee2mqtt/discussions/24198) announcement for 2.0.0.

- `nodePackages.vls` has been deprecated, as the upstream consumer of it, vetur, has been deprecated by upstream. Upstream suggests migrating to Volar for Vue LSP tooling instead.

- `nodePackages.create-react-native-app` has been removed, as it is deprecated. Upstream suggests using a framework for React Native apps instead.
+1 −0
Original line number Diff line number Diff line
@@ -125,6 +125,7 @@ in
        SystemCallFilter = [
          "@system-service @pkey"
          "~@privileged @resources"
          "@chown"
        ];
        UMask = "0077";
      };
+8 −1
Original line number Diff line number Diff line
@@ -1261,7 +1261,14 @@ in {
  zenohd = handleTest ./zenohd.nix {};
  zeronet-conservancy = handleTest ./zeronet-conservancy.nix {};
  zfs = handleTest ./zfs.nix {};
  zigbee2mqtt = handleTest ./zigbee2mqtt.nix {};
  zigbee2mqtt_1 = runTest {
    imports = [ ./zigbee2mqtt.nix ];
    _module.args.package = pkgs.zigbee2mqtt_1;
  };
  zigbee2mqtt_2 = runTest {
    imports = [ ./zigbee2mqtt.nix ];
    _module.args.package = pkgs.zigbee2mqtt_2;
  };
  zipline = handleTest ./zipline.nix {};
  zoneminder = handleTest ./zoneminder.nix {};
  zookeeper = handleTest ./zookeeper.nix {};
+40 −30
Original line number Diff line number Diff line
import ./make-test-python.nix (
  { pkgs, lib, ... }:
{
    name = "zigbee2mqtt";
    nodes.machine =
      { pkgs, ... }:
  lib,
  package,
  pkgs,
  ...
}:

let
  error =
    if lib.versionOlder package.version "2" then
      "Inappropriate ioctl for device, cannot set"
    else
      "No valid USB adapter found";
in
{
  name = "zigbee2mqtt-${lib.versions.major package.version}.x";
  nodes.machine = {
    systemd.services.dummy-serial = {
      wantedBy = [
        "multi-user.target"
@@ -16,6 +26,7 @@ import ./make-test-python.nix (

    services.zigbee2mqtt = {
      enable = true;
      inherit package;
    };

    systemd.services.zigbee2mqtt.serviceConfig.DevicePolicy = lib.mkForce "auto";
@@ -25,10 +36,9 @@ import ./make-test-python.nix (
    machine.wait_for_unit("multi-user.target")
    machine.wait_until_fails("systemctl status zigbee2mqtt.service")
    machine.succeed(
          "journalctl -eu zigbee2mqtt | grep 'Error: Inappropriate ioctl for device, cannot set'"
        "journalctl -eu zigbee2mqtt | grep '${error}'"
    )

    machine.log(machine.succeed("systemd-analyze security zigbee2mqtt.service"))
  '';
}
)
+1 −51
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  buildNpmPackage,
  fetchFromGitHub,
  systemdMinimal,
  nixosTests,
  nix-update-script,
  withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal,
}:

buildNpmPackage rec {
  pname = "zigbee2mqtt";
  version = "1.42.0";

  src = fetchFromGitHub {
    owner = "Koenkk";
    repo = "zigbee2mqtt";
    rev = version;
    hash = "sha256-/7mZrf3FyIliCzsy6yzVRJYMy4bViphYi81UY43iO98=";
  };

  npmDepsHash = "sha256-heqTYLC+TQPQ2dc5MrVdvJeNqrygC4tUgkLcfKvlYvE=";

  buildInputs = lib.optionals withSystemd [
    systemdMinimal
  ];

  npmFlags = lib.optionals (!withSystemd) [ "--omit=optional" ];

  passthru.tests.zigbee2mqtt = nixosTests.zigbee2mqtt;
  passthru.updateScript = nix-update-script { };

  meta = with lib; {
    changelog = "https://github.com/Koenkk/zigbee2mqtt/releases/tag/${version}";
    description = "Zigbee to MQTT bridge using zigbee-shepherd";
    homepage = "https://github.com/Koenkk/zigbee2mqtt";
    license = licenses.gpl3;
    longDescription = ''
      Allows you to use your Zigbee devices without the vendor's bridge or gateway.

      It bridges events and allows you to control your Zigbee devices via MQTT.
      In this way you can integrate your Zigbee devices with whatever smart home infrastructure you are using.
    '';
    maintainers = with maintainers; [
      sweber
      hexa
    ];
    mainProgram = "zigbee2mqtt";
  };
}
{ zigbee2mqtt_1 }: zigbee2mqtt_1
Loading