about summary refs log tree commit diff
path: root/pkgs/tools/misc/esphome
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2022-09-29 14:31:01 +0200
committerMartin Weinelt <hexa@darmstadt.ccc.de>2022-09-29 14:31:01 +0200
commite66af0e1105d45d2e4869357110d1d3dc88206c3 (patch)
treefce9d44317b495e86c631e719e349f79d703c2f2 /pkgs/tools/misc/esphome
parentc57357368c571c8646dec49675700b1a03758607 (diff)
esphome: add update script that includes the dashboard
Diffstat (limited to 'pkgs/tools/misc/esphome')
-rw-r--r--pkgs/tools/misc/esphome/default.nix1
-rw-r--r--pkgs/tools/misc/esphome/update.nix12
2 files changed, 13 insertions, 0 deletions
diff --git a/pkgs/tools/misc/esphome/default.nix b/pkgs/tools/misc/esphome/default.nix
index 4dc8058c83c4a..3ea44a8e30c62 100644
--- a/pkgs/tools/misc/esphome/default.nix
+++ b/pkgs/tools/misc/esphome/default.nix
@@ -91,6 +91,7 @@ with python.pkgs; buildPythonApplication rec {
 
   passthru = {
     dashboard = esphome-dashboard;
+    updateScript = callPackage ./update.nix {};
   };
 
   meta = with lib; {
diff --git a/pkgs/tools/misc/esphome/update.nix b/pkgs/tools/misc/esphome/update.nix
new file mode 100644
index 0000000000000..ea41376620546
--- /dev/null
+++ b/pkgs/tools/misc/esphome/update.nix
@@ -0,0 +1,12 @@
+{ writeShellScript
+, lib
+, git
+, nix-update
+}:
+
+writeShellScript "update-esphome" ''
+  PATH=${lib.makeBinPath [ git nix-update ]}
+
+  nix-update esphome.dashboard
+  nix-update esphome
+''