about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/home-assistant/custom-lovelace-modules/light-entity-card/default.nix
blob: 38b071f165648fecf040577f9c9f1211986fc962 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ lib
, buildNpmPackage
, fetchFromGitHub
}:

buildNpmPackage rec {
  pname = "light-entity-card";
  version = "6.1.1";

  src = fetchFromGitHub {
    owner = "ljmerza";
    repo = "light-entity-card";
    rev = "refs/tags/${version}";
    hash = "sha256-LoZt65oAw52NxVFgV9kVDr65CX5G6Xek2zDafDIxXmw=";
  };

  npmDepsHash = "sha256-EZDTWtn3joikwiC5Kfn94+tXRDpBhMDHqHozfIkfbJ0=";

  env.NODE_OPTIONS = "--openssl-legacy-provider";

  installPhase = ''
    runHook preInstall

    mkdir $out
    cp -v dist/light-entity-card.js* $out/

    runHook postInstall
  '';

  passthru.entrypoint = "light-entity-card.js";

  meta = with lib; {
    description = "Control any light or switch entity";
    homepage = "https://github.com/ljmerza/light-entity-card";
    changelog = "https://github.com/ljmerza/light-entity-card/releases/tag/${version}";
    maintainers = with maintainers; [ SuperSandro2000 ];
    license = licenses.mit;
  };
}