diff --git a/.gitignore b/.gitignore index 6614a6d..4b21987 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ htmlcov scripts/sync_to_blitz.personal.sh docker/.env .venv +pyrightconfig.json # Nix result + diff --git a/README.md b/README.md index d8d5b2f..baa8ba3 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ This software is still considered BETA and may contain bugs. Don't expose it to - [Linux / macOS](#linux--macos-1) - [Windows](#windows-1) - [Development](#development) + - [Using the nix package manager](#using-the-nix-package-manager) - [Installation](#installation-1) - [Sync changes to a RaspiBlitz](#sync-changes-to-a-raspiblitz) - [Debugging code running on a remote machine via VSCode](#debugging-code-running-on-a-remote-machine-via-vscode) @@ -99,6 +100,18 @@ poetry shell (To exit the poetry shell use: `exit`) +#### Using the nix package manager +Blitz API provides a [Nix](https://github.com/NixOS/nix) Flake file to create a development environment. Execute `nix develop` (make sure you have flakes enabled) to enter the environment. + +In this environment a hidden folder `.venv` is created to install the python dependencies locally. If pyright can't find these dependencies create the following file in the root +folder of the project: +```json +{ + "venvPath": ".", + "venv": ".venv" +} +``` + ### Installation ``` diff --git a/flake.nix b/flake.nix index 6dd94dd..c6c3484 100644 --- a/flake.nix +++ b/flake.nix @@ -31,6 +31,11 @@ ]; venvDir = "./.venv"; src = null; + shellHook = '' + export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [ + pkgs.stdenv.cc.cc + ]} + ''; postVenv = '' unset SOURCE_DATE_EPOCH '';