5 ms·
Some advantage over portage? I think that portage has all of these features plus USE flags and source code compilation (and it also supports binaries).
by samsaga2 12y ago
Some advantage over portage?
I think that portage has all of these features plus USE flags and source code compilation (and it also supports binaries).
- dozzie 12y agoOver portage? Installation time, outcome repeatability (how many binary packages do you have installed?) and ability to reliably roll back to previous state.
- contingencies 12y agoI am very familiar with portage. If 'installation time' is touted as improved, then zero compilation is implied. That means lost portability and binary packages, which is unacceptable to many. As for repeatability, anything that touches the network is by definition unreliable. Portage offers package caching. To make portage operations repeatable it is necessary to snapshot the system, kernel and portage tree, run emerge --fetchonly <package-spec> then provide the resulting /usr/portage/distfiles/ as part of the environment seeking to repeat the process. It's achievable, but non-trivial. Gentoo-family distribution developers do not optimize for this use case but it does work well. Personally I have created an alternative to the other options in this space (thoughts at http://stani.sh/walter/pfcts http://stani.sh/walter/pfcts) and am attempting full cross-platform support (any OS, any build system or deployment process).
- darklajid 12y agoPortage is a 'ports for Linux' (that's .. the reason for the name). It takes the BSD approach and adds a little here and there. But it has nothing to do with Nix except that it's 'package management'. nix allows you to roll back to a previous state. That doesn't mean emerge-ing older versions again or grabbing that package you have in your distfiles folder and installing that. Every operation is creating a new 'generation' and you can go back with a rollback. Think a revision control system - you just added a new revision, which points to new packages, but you can set the 'current' pointer back to "What I had yesterday". Having the ability to install multiple versions of a package doesn't mean portage slots (Hey, I can have multiple gcc versions), it means that you can install every package in multiple versions. You can install stuff without root, i.e. joeuser installs mysql. (While I had an idea about Nix and worked a good deal with portage/the BSD port collections, most of the stuff above is written after checking with the site again/looking at the user's guide. I assume people vote you down for not checking what Nix is)
- samsaga2 12y agoYou can also rollback with portage using demerge.
- darklajid 12y agoK, let me be honest: I haven't heard about demerge before, ever. Interesting and cool! That's still not the same thing though. It's a wrapper around portage for all I can tell and uses portage to get back to some previous (destroyed!) state. Nix doesn't mutate (well, ignoring garbage collects) and provides this out of the box. demerge is a utility that I have to install on top of portage (provided I know about it) and portage itself doesn't know a thing about it. Oh, and it was last touched in 2008. Back to the first line: Good argument though, it _does_ provide rollbacks for portage and - if it still works as advertised and is reliable enough - can simulate a somewhat similar feature, I give you that.
- viraptor 12y ago> nix allows you to roll back to a previous state. Please correct me if I'm wrong, but the way I read it, it actually rolls back to previous software versions, rather than previous state. Which is a small part of a state rollback - that would have to also include repeatable data migration both ways.
- sparkie 12y agoA rollback to a previous software version isn't "download the old version and replace the current one" as would happen with Portage, or most package managers. When you install new software, the old ones are not automatically overwritten - packages are immutable and cannot be "replaced" - you can only introduce a new package for the same software, which also requires that all of the dependants of that software be updated to use the new one. As to the question of what is rolled back - that depends entirely on what you put into your Nixpkg. Every package derivation is built inside a chroot environment, and only the explicit dependency graph described in the package is made available to the environment, which ensures that packages are built in ways that cannot depend on arbitrary data which is not specified up-front. The package format is used for configurations, and can be used for data too - if you just treat your data itself as a package, or part of another. This won't work for frequently changing data, such as databases - and as such, irreversible state changes cannot be rolled back - you generally need a full backup solution and a bespoke migration strategy for that kind of change anyway.
- davexunit 12y agoDoes portage have reproducible and (generally) bit-identical builds? per-user package installation? atomic upgrades and rollbacks?
- amirouche 12y agoNo. Portage isn't "append-only", it overwrites previous state for ever.
- wmertens 12y agoOne big difference is that _the entire system_ is built using Nix, including configuration files. Nothing in /etc is editable, everything goes through /etc/nixos/configuration.nix followed by a `nixos-rebuild switch` (does the entire build before atomically switching) and a `nixos-rebuild switch --rollback` (takes a few seconds) if you panic. The configuration is just a Nix expression so you can do whatever you like with it, it's not like a JSON file but actually integrates with your packages, allowing you to override settings etc. There are options which are the same as USE flags, for example you can turn off X with `environment.noXlibs=true` and the entire system would be rebuilt without X. It's at the same time much simpler than portage and much more expressive.
- Lethalman 12y agoUSE flags are just different inputs to the functions that build stuff in nix, which is most probably even more flexible in nix. Nix is mixed binary and source compilation when there's no cache.