Skip to content

Commit

Permalink
zigbee2mqtt: 1.42.0 -> 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mweinelt committed Jan 5, 2025
1 parent bf689c4 commit e7c6445
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 10 deletions.
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2505.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@
access or want to access home directory via `killHook`, hardening setting can
be changed via, e.g. `systemd.services.earlyoom.serviceConfig.ProtectSystem`.

- `zigbee2mqtt` was updated beyond version 2.0. This brings many [breaking changes](https://github.com/Koenkk/zigbee2mqtt/discussions/24198) that should be taken into account during an upgrade.

- `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.
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/home-automation/zigbee2mqtt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ in
SystemCallFilter = [
"@system-service @pkey"
"~@privileged @resources"
"@chown"
];
UMask = "0077";
};
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/zigbee2mqtt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ 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 'No valid USB adapter found'"
)
machine.log(machine.succeed("systemd-analyze security zigbee2mqtt.service"))
Expand Down
40 changes: 31 additions & 9 deletions pkgs/by-name/zi/zigbee2mqtt/package.nix
Original file line number Diff line number Diff line change
@@ -1,38 +1,60 @@
{
lib,
stdenv,
buildNpmPackage,
fetchFromGitHub,
nodejs,
npmHooks,
pnpm_9,
systemdMinimal,
nixosTests,
nix-update-script,
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal,
}:

buildNpmPackage rec {
let
pnpm = pnpm_9;
in
stdenv.mkDerivation (finalAttrs: {
pname = "zigbee2mqtt";
version = "1.42.0";
version = "2.0.0";

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

npmDepsHash = "sha256-heqTYLC+TQPQ2dc5MrVdvJeNqrygC4tUgkLcfKvlYvE=";
pnpmDeps = pnpm.fetchDeps {
inherit (finalAttrs) pname version src;
hash = "sha256-fijMAt6nSbXhrm1gougcVOF1VGB3EiwnpbTE4wxy508=";
};

nativeBuildInputs = [
nodejs
npmHooks.npmInstallHook
pnpm.configHook
];

buildInputs = lib.optionals withSystemd [
systemdMinimal
];

npmFlags = lib.optionals (!withSystemd) [ "--omit=optional" ];
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/${version}";
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;
Expand All @@ -48,4 +70,4 @@ buildNpmPackage rec {
];
mainProgram = "zigbee2mqtt";
};
}
})

0 comments on commit e7c6445

Please sign in to comment.