anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / tools / misc / esphome / dashboard.nix
blob4f78863812e2f8729959af894fa1dbef5eac19ca
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , fetchNpmDeps
6 # build-system
7 , setuptools
8 , nodejs
9 , npmHooks
13 buildPythonPackage rec {
14   pname = "esphome-dashboard";
15   version = "20240620.0";
16   pyproject = true;
18   src = fetchFromGitHub {
19     owner = "esphome";
20     repo = "dashboard";
21     rev = "refs/tags/${version}";
22     hash = "sha256-LmIxfX3rcRK90h31J0B5T02f48MCctFERgXxf0zkDm0=";
23   };
25   npmDeps = fetchNpmDeps {
26     inherit src;
27     hash = "sha256-xMVESS1bPNJF07joUgY8ku+GWtflWhM8mYAv0emggc8=";
28   };
30   build-system = [ setuptools ];
32   nativeBuildInputs = [
33     nodejs
34     npmHooks.npmConfigHook
35   ];
37   postPatch = ''
38     # https://github.com/esphome/dashboard/pull/639
39     patchShebangs script/build
40   '';
42   preBuild = ''
43     script/build
44   '';
46   # no tests
47   doCheck = false;
49   pythonImportsCheck = [
50     "esphome_dashboard"
51   ];
53   meta = with lib; {
54     description = "ESPHome dashboard";
55     homepage = "https://esphome.io/";
56     license = with licenses; [ asl20 ];
57     maintainers = with maintainers; [ hexa ];
58   };