commit 9654e56fcd2d0d7d0df13529b90171f0d74f2b41 Author: Jonas Rabenstein Date: Wed Jul 30 15:35:54 2025 +0200 init diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..3661e64 --- /dev/null +++ b/flake.lock @@ -0,0 +1,25 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1753750875, + "narHash": "sha256-J1P0aQymehe8AHsID9wwoMjbaYrIB2eH5HftoXhF9xk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "871381d997e4a063f25a3994ce8a9ac595246610", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..11d1575 --- /dev/null +++ b/flake.nix @@ -0,0 +1,16 @@ +{ + outputs = { self, nixpkgs, ... }: let + lib = nixpkgs.lib; + + scan = base: lib.attrsets.mapAttrs' (name: _: { + name = lib.strings.removeSuffix ".nix" (builtins.baseNameOf name); + value = import "${base}/${name}"; + }) (builtins.readDir base); + + packages = let + packages = scan ./packages; + in system: pkgs: builtins.mapAttrs (_: fn: pkgs.callPackage fn {}) packages; + in { + packages = builtins.mapAttrs packages nixpkgs.legacyPackages; + }; +} diff --git a/packages/riotee-probe.nix b/packages/riotee-probe.nix new file mode 100644 index 0000000..932d3d4 --- /dev/null +++ b/packages/riotee-probe.nix @@ -0,0 +1,42 @@ +let + version_hash."v1.1.0" = "sha256-W6qxZThRbwiuKpmavUBzCNs6E3nS2hpMSFHmga6wPTA="; +in { + lib, + version ? "v1.1.0", + python3, + python3Packages, + fetchFromGitHub, +}: let + git = fetchFromGitHub { + owner = "NessieCircuits"; + repo = "Riotee_ProbeSoftware"; + rev = version; + hash = version_hash.${version} or ""; + }; + dependencies = with python3Packages; [ + numpy + intelhex + click + pyserial + progress + pyocd + ]; +in python3Packages.buildPythonPackage { + pname = "riotee-probe"; + version = version; + + format = "pyproject"; + + nativeBuildInputs = with python3Packages; [ + flit-core + ] ++ dependencies; + + inherit dependencies; + + src = "${git}/tool"; + + postFixup = '' + mkdir -p $out/lib/udev/rules.d + cp ${git}/52-riotee.rules $out/lib/udev/rules.d + ''; +}