From 133efe0ba985a71ebe0ea8c4bc000dc306074220 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 11 Aug 2025 13:30:29 +0200 Subject: [PATCH] zigbee2mqtt_1: drop and return to unversioned attribute --- nixos/tests/all-tests.nix | 9 +-- nixos/tests/zigbee2mqtt.nix | 17 +---- pkgs/by-name/zi/zigbee2mqtt/package.nix | 75 ++++++++++++++++++++++- pkgs/by-name/zi/zigbee2mqtt_1/package.nix | 51 --------------- pkgs/by-name/zi/zigbee2mqtt_2/package.nix | 74 ---------------------- pkgs/top-level/aliases.nix | 2 + 6 files changed, 80 insertions(+), 148 deletions(-) delete mode 100644 pkgs/by-name/zi/zigbee2mqtt_1/package.nix delete mode 100644 pkgs/by-name/zi/zigbee2mqtt_2/package.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index bbc66e837e56..60d8f22a1d18 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -1622,14 +1622,7 @@ in zenohd = runTest ./zenohd.nix; zeronet-conservancy = runTest ./zeronet-conservancy.nix; zfs = handleTest ./zfs.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; - }; + zigbee2mqtt = runTest ./zigbee2mqtt.nix; zipline = runTest ./zipline.nix; zoneminder = runTest ./zoneminder.nix; zookeeper = runTest ./zookeeper.nix; diff --git a/nixos/tests/zigbee2mqtt.nix b/nixos/tests/zigbee2mqtt.nix index bcc1f4ea45f7..9f57d1f70ddc 100644 --- a/nixos/tests/zigbee2mqtt.nix +++ b/nixos/tests/zigbee2mqtt.nix @@ -1,19 +1,11 @@ { 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"; + name = "zigbee2mqtt"; nodes.machine = { systemd.services.dummy-serial = { wantedBy = [ @@ -24,10 +16,7 @@ in }; }; - services.zigbee2mqtt = { - enable = true; - inherit package; - }; + services.zigbee2mqtt.enable = true; systemd.services.zigbee2mqtt.serviceConfig.DevicePolicy = lib.mkForce "auto"; }; @@ -36,7 +25,7 @@ in machine.wait_for_unit("multi-user.target") machine.wait_until_fails("systemctl status zigbee2mqtt.service") machine.succeed( - "journalctl -eu zigbee2mqtt | grep '${error}'" + "journalctl -eu zigbee2mqtt | grep 'No valid USB adapter found'" ) machine.log(machine.succeed("systemd-analyze security zigbee2mqtt.service")) diff --git a/pkgs/by-name/zi/zigbee2mqtt/package.nix b/pkgs/by-name/zi/zigbee2mqtt/package.nix index d93139046212..3401827e0c77 100644 --- a/pkgs/by-name/zi/zigbee2mqtt/package.nix +++ b/pkgs/by-name/zi/zigbee2mqtt/package.nix @@ -1 +1,74 @@ -{ zigbee2mqtt_2 }: zigbee2mqtt_2 +{ + lib, + stdenv, + fetchFromGitHub, + nodejs, + npmHooks, + pnpm_9, + systemdMinimal, + nixosTests, + nix-update-script, + withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal, +}: + +let + pnpm = pnpm_9; +in +stdenv.mkDerivation (finalAttrs: { + pname = "zigbee2mqtt"; + version = "2.6.0"; + + src = fetchFromGitHub { + owner = "Koenkk"; + repo = "zigbee2mqtt"; + tag = finalAttrs.version; + hash = "sha256-syzrH3hJinAcpdyVlwEevqzi0LZ+gBMvJOXncuafzjE="; + }; + + pnpmDeps = pnpm.fetchDeps { + inherit (finalAttrs) pname version src; + fetcherVersion = 1; + hash = "sha256-EJgR1xjQJGKBdgJ2BGFiumVwZViXn7GJNa4GPkkscDg="; + }; + + nativeBuildInputs = [ + nodejs + npmHooks.npmInstallHook + pnpm.configHook + ]; + + buildInputs = lib.optionals withSystemd [ + systemdMinimal + ]; + + buildPhase = '' + runHook preBuild + + pnpm run build + + runHook postBuild + ''; + + dontNpmPrune = true; + + passthru.tests.zigbee2mqtt = nixosTests.zigbee2mqtt; + passthru.updateScript = nix-update-script { }; + + meta = with lib; { + changelog = "https://github.com/Koenkk/zigbee2mqtt/releases/tag/${finalAttrs.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"; + }; +}) diff --git a/pkgs/by-name/zi/zigbee2mqtt_1/package.nix b/pkgs/by-name/zi/zigbee2mqtt_1/package.nix deleted file mode 100644 index 235a25af498e..000000000000 --- a/pkgs/by-name/zi/zigbee2mqtt_1/package.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ - 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_1; - passthru.updateScript = nix-update-script { }; - - meta = { - changelog = "https://github.com/Koenkk/zigbee2mqtt/releases/tag/${version}"; - description = "Zigbee to MQTT bridge using zigbee-shepherd"; - homepage = "https://github.com/Koenkk/zigbee2mqtt"; - license = lib.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 lib.maintainers; [ - sweber - hexa - ]; - mainProgram = "zigbee2mqtt"; - }; -} diff --git a/pkgs/by-name/zi/zigbee2mqtt_2/package.nix b/pkgs/by-name/zi/zigbee2mqtt_2/package.nix deleted file mode 100644 index 26c187af31c2..000000000000 --- a/pkgs/by-name/zi/zigbee2mqtt_2/package.nix +++ /dev/null @@ -1,74 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub, - nodejs, - npmHooks, - pnpm_9, - systemdMinimal, - nixosTests, - nix-update-script, - withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal, -}: - -let - pnpm = pnpm_9; -in -stdenv.mkDerivation (finalAttrs: { - pname = "zigbee2mqtt"; - version = "2.6.0"; - - src = fetchFromGitHub { - owner = "Koenkk"; - repo = "zigbee2mqtt"; - tag = finalAttrs.version; - hash = "sha256-syzrH3hJinAcpdyVlwEevqzi0LZ+gBMvJOXncuafzjE="; - }; - - pnpmDeps = pnpm.fetchDeps { - inherit (finalAttrs) pname version src; - fetcherVersion = 1; - hash = "sha256-EJgR1xjQJGKBdgJ2BGFiumVwZViXn7GJNa4GPkkscDg="; - }; - - nativeBuildInputs = [ - nodejs - npmHooks.npmInstallHook - pnpm.configHook - ]; - - buildInputs = lib.optionals withSystemd [ - systemdMinimal - ]; - - buildPhase = '' - runHook preBuild - - pnpm run build - - runHook postBuild - ''; - - dontNpmPrune = true; - - passthru.tests.zigbee2mqtt = nixosTests.zigbee2mqtt_2; - passthru.updateScript = nix-update-script { }; - - meta = with lib; { - changelog = "https://github.com/Koenkk/zigbee2mqtt/releases/tag/${finalAttrs.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"; - }; -}) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 003462e80623..d427f0bc56b9 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -2260,6 +2260,8 @@ mapAliases { zig_0_9 = throw "zig 0.9 has been removed, upgrade to a newer version instead"; # Added 2025-01-24 zig_0_10 = throw "zig 0.10 has been removed, upgrade to a newer version instead"; # Added 2025-01-24 zig_0_11 = throw "zig 0.11 has been removed, upgrade to a newer version instead"; # Added 2025-04-09 + zigbee2mqtt_1 = throw "Zigbee2MQTT 1.x has been removed, upgrade to the unversioned attribute."; # Added 2025-08-11 + zigbee2mqtt_2 = zigbee2mqtt; # Added 2025-08-11 zimlib = throw "'zimlib' has been removed because it was an outdated and unused version of 'libzim'"; # Added 2025-03-07 zinc = zincsearch; # Added 2023-05-28 zint = zint-qt; # Added 2025-05-15