4 ms·
Portage 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 N
by darklajid 13y ago
Portage 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 13y agoYou can also rollback with portage using demerge.
- darklajid 13y 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 13y 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 13y 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.
- vertex-four 13y agoNote that previous software versions also includes previous configuration files. I don't believe there's anyone who manages things like database schemas via Nix, you're right there. EDIT: Thinking about it, it should be theoretically possible to write a schema migration layer on top of Nix. In the system activation script, copy all schema migration scripts to some directory (/var/schema or similar), then run the schema migration tool. When you try to rollback, all the schema migration scripts will still be in that directory, so the schema migration tool can rollback as well.