forked from M-Labs/thermostat
flake: Introduce PyThermostat scripts to devShell
Make executable Python scripts in the PyThermostat root available in the development shell (e.g. thermostat_plot, thermostat_autotune, thermostat_test).
This commit is contained in:
parent
9d218b3fa5
commit
16c78c5784
14
flake.nix
14
flake.nix
@ -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/thermostat_$progname
|
||||
echo "#!${pkgs.bash}/bin/bash" >> $outname
|
||||
echo "exec python -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
0
pythermostat/autotune.py
Normal file → Executable file
0
pythermostat/plot.py
Normal file → Executable file
0
pythermostat/plot.py
Normal file → Executable file
0
pythermostat/test.py
Normal file → Executable file
0
pythermostat/test.py
Normal file → Executable file
Loading…
Reference in New Issue
Block a user