From 9d218b3fa5fbb8b3185ceda008574ba317f7f09a Mon Sep 17 00:00:00 2001 From: atse Date: Mon, 28 Oct 2024 18:05:59 +0800 Subject: [PATCH] flake: Add pythermostat to PYTHONPATH in devshell For easier testing of PyThermostat client code in the development shell, so that the following is possible right in the repo root: ``` $ python Python 3.11.9 (main, Apr 2 2024, 08:25:04) [GCC 13.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from pythermostat.client import Client >>> c = Client() >>> ``` --- flake.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index c846d21..ad432c6 100644 --- a/flake.nix +++ b/flake.nix @@ -63,11 +63,10 @@ version = "0.0.0"; src = "${self}/pythermostat"; - propagatedBuildInputs = - with pkgs.python3Packages; [ - numpy - matplotlib - ]; + propagatedBuildInputs = with pkgs.python3Packages; [ + numpy + matplotlib + ]; }; in { @@ -95,6 +94,9 @@ numpy matplotlib ]); + shellHook = '' + export PYTHONPATH=`git rev-parse --show-toplevel`/pythermostat:$PYTHONPATH + ''; }; formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;