depot/third_party/nixpkgs/pkgs/servers/home-assistant/custom-lovelace-modules/button-card/default.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

52 lines
1 KiB
Nix

{ lib
, mkYarnPackage
, fetchYarnDeps
, fetchFromGitHub
}:
mkYarnPackage rec {
pname = "button-card";
version = "4.1.2";
src = fetchFromGitHub {
owner = "custom-cards";
repo = "button-card";
rev = "v${version}";
hash = "sha256-Ntg1sNgAehcL2fT0rP0YHzV5q6rB5p1TyFXtbZyB3Vo=";
};
packageJSON = ./package.json;
offlineCache = fetchYarnDeps {
yarnLock = src + "/yarn.lock";
hash = "sha256-OFnsRR9zA9D22xBdh4XfLueGVA2ERXmGEp54x0OFDFY=";
};
buildPhase = ''
runHook preBuild
yarn build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir $out
cp ./deps/button-card/dist/button-card.js $out
runHook postInstall
'';
doDist = false;
meta = with lib; {
description = "Lovelace button-card for home assistant";
homepage = "https://github.com/custom-cards/button-card";
changelog = "https://github.com/custom-cards/button-card/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ k900 ];
platforms = platforms.all;
};
}