From 8dba674fa64da955ddde508a13d1ab4a80997cc8 Mon Sep 17 00:00:00 2001 From: Amit Aryeh Levy Date: Wed, 14 May 2025 10:34:52 -0700 Subject: [PATCH 1/2] Update default.nix to newer nix's and sync version This adds the necessary Python dependencies for newer versions of tocklodaer, updates the names of a nix dependency, and parses the Python `_version.py` file to get the package version number, to avoid replicating and stagnation. --- default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/default.nix b/default.nix index 2737685..4565454 100644 --- a/default.nix +++ b/default.nix @@ -20,7 +20,7 @@ let ]; propagatedBuildInputs = with pkgs; [ - segger-jlink libusb + segger-jlink libusb1 ]; installPhase = '' @@ -74,7 +74,9 @@ let }); in pkgs.python3Packages.buildPythonPackage rec { pname = "tockloader"; - version = "1.10.0"; + version = let + pattern = "^__version__ = ['\"]([^'\"]*)['\"]\n"; + in elemAt (match pattern (readFile ./tockloader/_version.py)) 0; name = "${pname}-${version}"; propagatedBuildInputs = with python3Packages; [ @@ -87,6 +89,7 @@ in pkgs.python3Packages.buildPythonPackage rec { questionary pycrypto siphash + ecdsa ] ++ (lib.optional withUnfreePkgs pynrfjprog); src = ./.; From cf79b052c9315168038d4da766b4e2aaf3b2e150 Mon Sep 17 00:00:00 2001 From: autoblack Date: Wed, 14 May 2025 17:36:33 +0000 Subject: [PATCH 2/2] fixup: Format Python code with Black --- tockloader/tickv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tockloader/tickv.py b/tockloader/tickv.py index ea0ed3c..6168f7a 100644 --- a/tockloader/tickv.py +++ b/tockloader/tickv.py @@ -369,7 +369,7 @@ def reset(self): def _reset(self): db_len = len(self.storage_binary) - self.storage_binary = bytearray(b"\xFF" * db_len) + self.storage_binary = bytearray(b"\xff" * db_len) # Add the known initialize key, value. I don't know what this key # is from, but it is the standard.