top | item 32504223

(no title)

coffee-cup | 3 years ago

You are correct in that Nixpacks uses the languages own package manager instead of installing all dependencies with Nix using tools like node2nix, cargo2nix, or poetry2nix. This was a choice as the main problems Nixpacks aims to solve are with system dependencies and getting an environment where your app can install and build with as little configuration as possible. While continuing to use the same tooling that app authors are likely using locally (e.g. npm, pip, cargo). We have found that nixifying all possible deps often creates situations where the app author must know that Nix is being used under the hood and modify their app accordingly. Nothing against these tools, but using them didn't provide the experience we set out to have. If a user of Nixpacks wants to override the install command to `do_something && npm install`, they should be able to without worrying about how it affects the Nix store.

However, any Nix package can be installed, including from python-packages.nix, and we are planning on allowing more Nix config and customization in the future.

discuss

order

ris|3 years ago

Indeed, it's a compromise. Something I can't figure out though is if you make any attempt to remove unnecessary nix packages for the final image, i.e. in cases where a (language-)package has a native module built from source, can you generate a final image without gcc present?

There are a couple of sneaky ways this could possibly be done, but wondered if you explored any of them.

justjake|3 years ago

I don’t think we are ATM but would absolutely love a PR/suggestion for this!

Would love to drop image sizes