flake: Add pytec runnables to devShell

Makes it possible to directly run `plot` and `autotune` in the shell.
This commit is contained in:
atse 2024-08-23 11:30:16 +08:00
parent a7aa78a608
commit c8b6bf01d1
3 changed files with 14 additions and 0 deletions

View File

@ -49,6 +49,19 @@
dontFixup = true;
auditable = false;
};
pytec-dev-wrappers = pkgs.runCommandNoCC "pytec-dev-wrappers" { } ''
mkdir -p $out/bin
for program in ${self}/pytec/*.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 pytec.$progname \"\$@\"" >> $outname
chmod 755 $outname
fi
done
'';
in {
packages.x86_64-linux = {
inherit thermostat;
@ -64,6 +77,7 @@
packages = with pkgs; [
rust llvm
openocd dfu-util rlwrap
pytec-dev-wrappers
] ++ (with python3Packages; [
numpy matplotlib
]);

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

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