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

This commit is contained in:
linuswck 2023-12-21 15:09:20 +08:00
parent 4d9302a218
commit ee2e86d796
1 changed files with 3 additions and 1 deletions

View File

@ -19,7 +19,8 @@
buildPhase = ''
# kicad-cli requires the use of $HOME
export HOME=/tmp
TMP_DIR="$(pwd)/$(mktemp -d tmp.XXXX)"
export HOME=$TMP_DIR
if [ "${variant}" != "copper_plate" ]; then
SCH=kirdy_LD_adapter_${variant}.kicad_sch
@ -56,6 +57,7 @@
export KICAD7_3DMODEL_DIR=${pkgs.kicad.libraries.packages3d}/share/kicad/3dmodels
kicad-cli pcb export step $PCB --subst-models --force -o $PREFIX.step
fi
rm -r $TMP_DIR
'';
installPhase = ''