From c05758fa41c9b15fa116818f5c5e6b7924488090 Mon Sep 17 00:00:00 2001
From: Sophie Tauchert <sophie@999eagle.moe>
Date: Wed, 16 Aug 2023 13:32:08 +0200
Subject: [PATCH] nix: add mpremote package

---
 nix/overlay/default.nix          |  1 +
 nix/overlay/mpremote/default.nix | 22 ++++++++++++++++++++++
 nix/pkgs.nix                     |  1 +
 3 files changed, 24 insertions(+)
 create mode 100644 nix/overlay/mpremote/default.nix

diff --git a/nix/overlay/default.nix b/nix/overlay/default.nix
index b79766713a..93eb8413b2 100644
--- a/nix/overlay/default.nix
+++ b/nix/overlay/default.nix
@@ -5,4 +5,5 @@
   esp-llvm = super.callPackage ./esp-llvm.nix {};
   esp-gdb = super.callPackage ./esp-gdb.nix {};
   run-clang-tidy = super.callPackage ./run-clang-tidy {};
+  mpremote = super.python310Packages.callPackage ./mpremote {};
 })
diff --git a/nix/overlay/mpremote/default.nix b/nix/overlay/mpremote/default.nix
new file mode 100644
index 0000000000..fac5e99936
--- /dev/null
+++ b/nix/overlay/mpremote/default.nix
@@ -0,0 +1,22 @@
+{ python3
+, fetchPypi
+}:
+python3.pkgs.buildPythonApplication rec {
+  pname = "mpremote";
+  version = "1.20.0";
+  format = "pyproject";
+  src = fetchPypi {
+    inherit pname version;
+    hash = "sha256-XDQnYqBHkTCd1JvOY8cKB1qnxUixwAdiYrlvnMw5jKI=";
+  };
+  doCheck = false;
+  nativeBuildInputs = with python3.pkgs; [
+    hatchling
+    hatch-requirements-txt
+    hatch-vcs
+  ];
+  propagatedBuildInputs = with python3.pkgs; [
+    pyserial
+    importlib-metadata
+  ];
+}
diff --git a/nix/pkgs.nix b/nix/pkgs.nix
index d15655e1d5..d4fd1febf8 100644
--- a/nix/pkgs.nix
+++ b/nix/pkgs.nix
@@ -35,5 +35,6 @@ in with nixpkgs; rec {
     emscripten
     ncurses5
     esp-gdb
+    mpremote
   ];
 }
-- 
GitLab