flake: Add pytec runnables to devShell

Makes it possible to directly run `autotune`, `plot` and `test` in the
devShell.
This commit is contained in:
atse 2024-08-23 11:30:16 +08:00
parent c9defac87c
commit d815a9ae55
4 changed files with 14 additions and 0 deletions

View File

@ -68,6 +68,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/$progname
echo "#!${pkgs.bash}/bin/bash" >> $outname
echo "exec python3 -m $progname \"\$@\"" >> $outname
chmod 755 $outname
fi
done
'';
in
{
packages.x86_64-linux = {
@ -89,6 +102,7 @@
openocd
dfu-util
rlwrap
pythermostat-dev-wrappers
]
++ (with python3Packages; [
numpy

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

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

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