forked from M-Labs/thermostat
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:
parent
d64c83953e
commit
1a3c831a06
14
flake.nix
14
flake.nix
@ -69,6 +69,19 @@
|
|||||||
matplotlib
|
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
|
in
|
||||||
{
|
{
|
||||||
packages.x86_64-linux = {
|
packages.x86_64-linux = {
|
||||||
@ -90,6 +103,7 @@
|
|||||||
openocd
|
openocd
|
||||||
dfu-util
|
dfu-util
|
||||||
rlwrap
|
rlwrap
|
||||||
|
pythermostat-dev-wrappers
|
||||||
]
|
]
|
||||||
++ (with python3Packages; [
|
++ (with python3Packages; [
|
||||||
numpy
|
numpy
|
||||||
|
0
pythermostat/pythermostat/autotune.py
Normal file → Executable file
0
pythermostat/pythermostat/autotune.py
Normal file → Executable file
0
pythermostat/pythermostat/plot.py
Normal file → Executable file
0
pythermostat/pythermostat/plot.py
Normal file → Executable file
0
pythermostat/pythermostat/test.py
Normal file → Executable file
0
pythermostat/pythermostat/test.py
Normal file → Executable file
Loading…
Reference in New Issue
Block a user