From b802e37bf4a52a889a346339b326b746d08d6faf Mon Sep 17 00:00:00 2001 From: linuswck Date: Thu, 21 Dec 2023 15:03:10 +0800 Subject: [PATCH] flake: Create TMP dir and use it for $HOME PATH --- flake.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 63da55c..9a2cdee 100644 --- a/flake.nix +++ b/flake.nix @@ -25,7 +25,8 @@ buildPhase = '' # 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 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"/ zip -r -j $PREFIX"_gerber_drill" $PREFIX"_gerber_drill" + + rm -r $TMP_DIR ''; installPhase = ''