From 32c08ba0ca88d7021014d623aaf846d2606332fc Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 17 Jul 2024 15:05:27 +0200 Subject: [PATCH 1/2] esphome: build dashboard from source --- pkgs/tools/misc/esphome/dashboard.nix | 41 +++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/misc/esphome/dashboard.nix b/pkgs/tools/misc/esphome/dashboard.nix index 0b485ad49e6a..4f78863812e2 100644 --- a/pkgs/tools/misc/esphome/dashboard.nix +++ b/pkgs/tools/misc/esphome/dashboard.nix @@ -1,19 +1,48 @@ { lib , buildPythonPackage -, fetchPypi +, fetchFromGitHub +, fetchNpmDeps + +# build-system +, setuptools +, nodejs +, npmHooks + }: buildPythonPackage rec { pname = "esphome-dashboard"; version = "20240620.0"; - format = "setuptools"; + pyproject = true; - src = fetchPypi { - pname = "esphome_dashboard"; - inherit version; - hash = "sha256-lx3i8Z2PUefyibCNiQ4zPEwfgXr6r/TVa9TBF0YE5fA="; + src = fetchFromGitHub { + owner = "esphome"; + repo = "dashboard"; + rev = "refs/tags/${version}"; + hash = "sha256-LmIxfX3rcRK90h31J0B5T02f48MCctFERgXxf0zkDm0="; }; + npmDeps = fetchNpmDeps { + inherit src; + hash = "sha256-xMVESS1bPNJF07joUgY8ku+GWtflWhM8mYAv0emggc8="; + }; + + build-system = [ setuptools ]; + + nativeBuildInputs = [ + nodejs + npmHooks.npmConfigHook + ]; + + postPatch = '' + # https://github.com/esphome/dashboard/pull/639 + patchShebangs script/build + ''; + + preBuild = '' + script/build + ''; + # no tests doCheck = false; From 7b5fa260f3f959ea2dae7148ce699ac043fc7410 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 17 Jul 2024 15:12:14 +0200 Subject: [PATCH 2/2] esphome: 2024.6.6 -> 2024.7.0 https://github.com/esphome/esphome/releases/tag/2024.7.0 --- pkgs/tools/misc/esphome/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/esphome/default.nix b/pkgs/tools/misc/esphome/default.nix index d9d05b161dd0..55e3f56a0471 100644 --- a/pkgs/tools/misc/esphome/default.nix +++ b/pkgs/tools/misc/esphome/default.nix @@ -19,14 +19,14 @@ let in python.pkgs.buildPythonApplication rec { pname = "esphome"; - version = "2024.6.6"; + version = "2024.7.0"; pyproject = true; src = fetchFromGitHub { owner = pname; repo = pname; rev = "refs/tags/${version}"; - hash = "sha256-/EGj6kEgUhQefdFz/IllKWeVGLhC3STiOOsy3Pq4pIM="; + hash = "sha256-bQGsLt8+WPaQfQ9ReKGrIS1O071LkpAxJerfHO3E0Oc="; }; nativeBuildInputs = with python.pkgs; [