flake: Create TMP dir and use it for $HOME PATH

This commit is contained in:
linuswck 2023-12-21 15:03:10 +08:00
parent 1a4b4a2484
commit b802e37bf4

View File

@ -25,7 +25,8 @@
buildPhase = '' buildPhase = ''
# kicad-cli requires the use of $HOME # kicad-cli requires the use of $HOME
export HOME=/tmp TMP_DIR="$(pwd)/$(mktemp -d tmp.XXXX)"
export HOME=$TMP_DIR
SCH=kirdy.kicad_sch SCH=kirdy.kicad_sch
PCB=kirdy.kicad_pcb PCB=kirdy.kicad_pcb
@ -51,6 +52,8 @@
kicad-cli pcb export drill $PCB -u mm --generate-map --map-format gerberx2 -o ./$PREFIX"_gerber_drill"/ kicad-cli pcb export drill $PCB -u mm --generate-map --map-format gerberx2 -o ./$PREFIX"_gerber_drill"/
zip -r -j $PREFIX"_gerber_drill" $PREFIX"_gerber_drill" zip -r -j $PREFIX"_gerber_drill" $PREFIX"_gerber_drill"
rm -r $TMP_DIR
''; '';
installPhase = '' installPhase = ''