| * Hello, just wondering what the process is for building my project locally from my Flake output.
I think the problem is how Flakes handle files in .gitignore? I have a dist/ folder that is generated via Webpack/Babel at build-time, and it is currently gitignore'd. Things work fine if I take it out of the .gitignore file and run
$ git add dist/
$ nix build
When I don't do that, the build fails with message: error: getting status of '/nix/store/miap1bv0r73waw5g52ln2gnqjq8848yl-source/dist': No such file or directory
I try to build the package using npmBuildPackage, which runs the npm run build script by default in the buildPhase. This is fine and it should use webpack/babel to produce a dist/ directory.
I don't define any custom buildPhase, but I do define a custom installPhase which is simply:
installPhase = ''
runHook preInstall
mkdir -p $out/
cp -r ./dist $out/dist
runHook postInstall
'';
Any ideas on how to get this to work? |