3 ms·
How does Nix work with less sophisticated package managers that run on top of it, e.g. Python's "pip"?
by amelius 5y ago
How does Nix work with less sophisticated package managers that run on top of it, e.g. Python's "pip"?
- opan 5y agoGuix, and I think Nix also, package the things from these other package managers so you can manage them all with the same package manager. This also means features like rollbacks can apply to your emacs packages. You can run pip on Guix System, but I don't think you'd have to, ideally. Same for rust's cargo and so on.
- amelius 5y agoOk, makes sense. Does that mean that you don't get the latest updates that are available in pip? Also, what happens if you incidentally run pip on a Nix system? Will it mess up your installation?
- 3836293648 5y agoI can't speak for pip, but cargo, rust's package manager, packages disappear on reboot. Doesn't matter for development since libraries are stored with your project, but any tools you install via cargo are gone
- opan 5y agoYou can update packages to newer commits ahead of guix itself updating the package with a simple command[0] as long as dependencies and such haven't changed. So, if guix were behind, you should be able to easily remedy it. [0] guix install mpv --with-commit=mpv=cc4ada655aae06218b900bb434e3521566394cde
- masklinn 5y agoIf you just use pip & co, nix will be unaware of it and won't care one way or another. It will basically treat your pip-installed stuff like it'd treat your sourcefiles or pdfs. Alternatively you can create derivations instead in which case the resulting artefacts will be fully understood and manageable by nix (I think there are integrations to do that e.g. tools like carnix which can automatically create derivations from existing language-specific packages, not sure if there's one for pip/pypi).
- amelius 5y ago> If you just use pip & co, nix will be unaware of it and won't care one way or another. It will basically treat your pip-installed stuff like it'd treat your sourcefiles or pdfs. Also if you run pip as root (to install for all users at once)?
- Nullabillity 5y agoIt fails, because NixOS mounts /nix/store (the Nix store, where all managed packages are stored) as read-only (with some trickery used by Nix itself to bypass this for its own builds). And if you bypass that, `nix-store --verify --check-contents` can detect the issue.
- amelius 5y agoThis is very reassuring, thanks.