flake: Introduce PyThermostat scripts to devShell

Make Python scripts in PyThermostat available in the development shell
(thermostat_plot, thermostat_autotune, and thermostat_test).
This commit is contained in:
atse 2024-08-23 11:30:16 +08:00
parent d64c83953e
commit 1a3c831a06
4 changed files with 14 additions and 0 deletions

View File

@ -69,6 +69,19 @@
matplotlib
];
};
pythermostat-dev-wrappers = pkgs.runCommandNoCC "pythermostat-dev-wrappers" { } ''
mkdir -p $out/bin
for program in ${self}/pythermostat/*.py; do
if [ -x $program ]; then
progname=`basename -s .py $program`
outname=$out/bin/thermostat_$progname
echo "#!${pkgs.bash}/bin/bash" >> $outname
echo "exec python -m $progname \"\$@\"" >> $outname
chmod 755 $outname
fi
done
'';
in
{
packages.x86_64-linux = {
@ -90,6 +103,7 @@
openocd
dfu-util
rlwrap
pythermostat-dev-wrappers
]
++ (with python3Packages; [
numpy

0
pythermostat/pythermostat/autotune.py Normal file → Executable file
View File

0
pythermostat/pythermostat/plot.py Normal file → Executable file
View File

0
pythermostat/pythermostat/test.py Normal file → Executable file
View File