4 ms·
A surprising downside to Nix containers is that a majority of packages are not optimized for containers. For example, trying adding a dependency to `git` and se
by sepositus 2y ago
A surprising downside to Nix containers is that a majority of packages are not optimized for containers. For example, trying adding a dependency to `git` and see how big the container grows. Granted, the good packages (like git) allow customization, but it requires really digging into the code. Some packages just straight up ship with a ton of bloat and the only thing you can do is basically fork and maintain it yourself.
- max-privatevoid 2y agoIt's a problem of nixpkgs. It would be cool to have an Alpine-like alternative package set focused on minimal package size.
- pxc 2y agoThere is, isn't there? That's what `pkgsStatic` in Nixpkgs is. Statically compiled packages with small closures built with musl, just like Alpine
- Rucadi 2y agoyou could try to statically link them if the package support it, it does so by using musl nix build github:NixOS/nixpkgs#pkgsStatic.git return the pacakge as: ls -lah git -r-xr-xr-x 1 rucadi rucadi 5.1M Jan 1 1970 git ldd git $ not a dynamic executable So you don't really need to really grow the container
- sepositus 2y agoYeah, it's a problem on a package-per-package basis. My point isn't how to solve the git problem but that the experience can vary wildly depending on the package. It can be surprising and often comes at the expense of time trying to navigate the insanity that is nixpkgs :)