about summary refs log tree commit diff
path: root/pkgs/servers/zigbee2mqtt/default.nix
diff options
context:
space:
mode:
authorNikolay Korotkiy <sikmir@disroot.org>2024-05-21 22:27:05 +0400
committerNikolay Korotkiy <sikmir@disroot.org>2024-05-21 22:27:05 +0400
commit25995c9ff8c079fb28e11a34ada6c4164ae9fff2 (patch)
tree339f669a11a044010f9f29391be49b724cd6c89c /pkgs/servers/zigbee2mqtt/default.nix
parent3eaeaeb6b1e08a016380c279f8846e0bd8808916 (diff)
zigbee2mqtt: make systemd support optional
Diffstat (limited to 'pkgs/servers/zigbee2mqtt/default.nix')
-rw-r--r--pkgs/servers/zigbee2mqtt/default.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkgs/servers/zigbee2mqtt/default.nix b/pkgs/servers/zigbee2mqtt/default.nix
index 8f2fe4ee00ef8..ac71a3e4881f7 100644
--- a/pkgs/servers/zigbee2mqtt/default.nix
+++ b/pkgs/servers/zigbee2mqtt/default.nix
@@ -1,9 +1,11 @@
 { lib
+, stdenv
 , buildNpmPackage
 , fetchFromGitHub
 , systemdMinimal
 , nixosTests
 , nix-update-script
+, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal
 }:
 
 buildNpmPackage rec {
@@ -19,10 +21,12 @@ buildNpmPackage rec {
 
   npmDepsHash = "sha256-AjCeRU/Ew9UquqGPuJeGRC48kCi9uRZaI5Bam365Wwk=";
 
-  buildInputs = [
+  buildInputs = lib.optionals withSystemd [
     systemdMinimal
   ];
 
+  npmFlags = lib.optionals (!withSystemd) [ "--omit=optional" ];
+
   passthru.tests.zigbee2mqtt = nixosTests.zigbee2mqtt;
   passthru.updateScript = nix-update-script { };
 
@@ -38,7 +42,6 @@ buildNpmPackage rec {
       In this way you can integrate your Zigbee devices with whatever smart home infrastructure you are using.
     '';
     maintainers = with maintainers; [ sweber hexa ];
-    platforms = platforms.linux;
     mainProgram = "zigbee2mqtt";
   };
 }