6 ms·
The Nix project – Atomic upgrades, rollbacks and multi-user package management
- iElectric2 13y agoNote: there is also a distribution built on top of Nix: http://nixos.org/nixos/ http://nixos.org/nixos/
- amirouche 13y agoI tested both guix on top of ubuntu and nixos, the distro. It's really nice. With Nix I was able to use Steam and play windows-only games :) It's great & usable without considering the new feature of "append-only" package management. nix is kind of database with a support for multiple versions of data, where data is programs, libraries, the system itself. I'm wondering whether it has a "freeze" command which allows to generate a stripped OS image without debug, without nix itself or support for nix features except a recipe to rebuild the frozen image with nix.
- amirouche 13y agoMaybe this nix-docker can help http://zef.me/6049/nix-docker http://zef.me/6049/nix-docker direct-link to nix-docker command line dance http://zef.me/6049/nix-docker#introducing-nix-docker http://zef.me/6049/nix-docker#introducing-nix-docker
- davexunit 13y agoSee also the Guix project: http://www.gnu.org/software/guix/ http://www.gnu.org/software/guix/ "GNU Guix is a purely functional package manager for the GNU system, and a distribution thereof."
- mercurial 13y agoOn one hand, I find Nix/NixOS fascinating, and I think package management should go in this direction. On the other hand, there is a weird dichotomy between nix-env and the main nix file, and I find that fairly common tasks such as "tell me the contents of package X" or "let's read the distro changelog and the upstream changelog for package X" to be either unintuitive or impossible. Not to bash Nix(OS) developers, because I think they're doing a great job.
- Lethalman 13y agoYes, in general you can't say "what version of X am I using?". You have to ask: "what version of X, the derivation Y is using?". You can see the contents of package X on your system, there's no index provided online for that. Also "contents of package X" is too general for nix, it's "contents of package X built with inputs Y", you may have the same package X built in different ways in your nix store. It's not impossible, there's the need of a service that provides information on what packages provide a certain file.
- samsaga2 13y agoSome 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 13y agoOver portage? Installation time, outcome repeatability (how many binary packages do you have installed?) and ability to reliably roll back to previous state.
- contingencies 13y 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 13y 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)
- lewaldman 13y agoWas thinking about install it as my main desktop environment... Went to check the packages and no AwesomeWM. Any one knows how hard is to add a package?
- darklajid 13y agoI considered something similar. No experience myself, but the starting points would be here: http://releases.nixos.org/nix/nix-1.7/manual/#chap-writing-nix-expressions http://releases.nixos.org/nix/nix-1.7/manual/#chap-writing-n... http://nixos.org/nixpkgs/manual/ http://nixos.org/nixpkgs/manual/ Looks alien to me (of course, it's new!), but not too scary. Might give it a spin in a VM at least.
- pmahoney 13y agoI found the nix expression language somewhat confusing at first, but I was able to create simple packages after a couple days. You can find many examples in nixpkgs, e.g. https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/window-managers/awesome/default.nix https://github.com/NixOS/nixpkgs/blob/master/pkgs/applicatio... Is that not AwesomeWM btw? There are some rough edges around package discovery (or holes in my knowledge). If you install nix locally (just the package manager, not NixOS), I usually query like this: nix-env -qaP | grep awesome Or I search through my local checkout of nixpkgs source. I'll say that I'm finding nix (just using the package manager, not NixOS) to be a very nice way to manage some custom-compiled packages. I was able to upgrade nginx, for example, from 1.5 to 1.6 with all my plugins and compile flags in place with just a few small changes. This is surely possible through other means, but my previous method of manually downloading/compiling/saving configure flags in my $HOME/src was sloppy.
- vertex-four 13y agoI currently use NixOS for a personal server (running on a Kimsufi Atom box at €10.20 a month). It's seriously awesome; I have my full operating system defined in a config file which can be versioned and backed up. I can write extra packages and custom services easily, as well, as part of my configuration. It even has its own declarative cloud management tool, NixOps. One issue is that at present, the system is very much rolling release with snapshots every 6 months called "releases". Unfortunately, there's not currently a good release management process; 14.04 was essentially managed by asking everyone not to merge anything major in the month before, then a week(?) of testing on a separate branch. If there's anyone with release management experience, I'm sure they'd appreciate some help. The IRC channel on Freenode is extremely friendly, for anyone who has difficulty setting it up. Someone else on here mentioned Guix; Guix is essentially Nix with a different language for defining packages. Nix's language is purely functional and lazy, but actually really simple; the nixpkgs library defines enough helpers that the vast majority of use of the language looks like a slightly more complex version of JSON.
- Seldaek 13y agoWould you mind sharing how you set it up on a Kimsufi/OVH machine? All infos I have found were quite outdated and I haven't had enough time to dig into it myself yet. I think it would be great if someone would document this.
- vertex-four 13y agoI could write it up on the wiki, but I've forgotten the finer details at this point. Basically, I followed the Linode instructions, using the Kimsufi rescue disk as a base. The problems that I ran into were that I had problems with the latest Nix tarball, so I used the latest release of Nix at the time instead[0] (probably a good idea anyway), and also that I needed to set up separate / and /boot partitions, as Nix wouldn't install when everything was on / for some reason (I think the Gentoo forums claim there's some issue with GRUB2 and ext4). Not having KVM access is hell when you're trying to figure out why your system won't boot, btw. [0] http://hydra.nixos.org/build/6695701 http://hydra.nixos.org/build/6695701
- 13y ago
- iElectric2 13y agoI'm using NixOS for my desktop (laptop), HTPC and servers.
- ambrop7 13y agoI'm using NixOS for my HPTC and home PC. It took some to set it all up, including adding a few new packages (mostly related to 3D printing) and fixing some, but now it's running well and I'm really happy. I've always wanted distro where I can have all the configuration on the same place and which I can use to reproduce the whole thing. There's a gotcha though. The default configuration will use the "channel" as the package repository (which is really just a nixpkgs snapshot that was automatically built by the build farm and automatically tested to some extent). Updating the channel is stateful - it's non-trivial to go back to a previous version of a channel, in case you want to extend and rebuild a working configuration (not just boot it). Personally I avoid the channels and instead just manage a nixpkgs git checkout, where you can make a tag whenever you're happy with the results of nixos-rebuild, possibly with an equally named tag in your configuration (/etc/nixos) repo. Another problem is the insecurity of the channels and the cache. By default Nix will try to fetch builds from cache.nixos.org, even if you don't use channels, and anyone capable of MITM could give you whatever he wants. So for the moment, I've disabled the cache on my systems and I build everything locally (and the nixpkgs is fetched over HTTPS). I think that signing is being worked on though. On a positive note, it's very easy to get help, and it's not hard at all to get fixes and package additions merged. All my added packages were merged in a few days, most within a few hours. In Gentoo I usually had an overlay with 15 or so packages, now I have just 2 local commits in nixpkgs. On the other hand, if you're using channels, making local changes is a bit harder than Gentoo's overlays.
- yetfeo 13y agoDo you have any tips on managing a nixpkgs clone vs using channels? How do you set it up to default to your clone for example?
- ambrop7 13y agoI wrap the nixos-rebuild command into a script that sets a custom nixpkgs: #!/bin/sh exec nixos-rebuild -I nixpkgs=/etc/nixos/nixpkgs "$@" This itself works, but then you're probably still using channels for nix-env (user profiles). These need to be configured separately. Or maybe with NIX_PATH, I don't know since I don't use the user profiles feature. After that, you just work with it like any git repo (presumably you, like git pull --rebase, git rebase -i...).
- aruggirello 13y agoVery interesting, and promising. It's a pity apt doesn't do that too. Though there is apt-btrfs-snapshot that conveniently fills the gap - though on btrfs only.
- yetfeo 13y agoNix has a number of nice things going for it. You can have multiple different versions of packages installed and other packages can depend on the different versions. The management of the 'shared library hell' is done behind the scenes using symbolic links in a GNU Stow like manner. You can create 'environments' that are collections of installed packages and switch between them so tools needed for one task don't pollute the namespace for other tasks. For example, I create an environment for working on Firefox. It uses specific GCC versions and libraries. Only that environment sees them. I then switch to another environment when working on another project which uses clang - that environment can't see the library versions from the firefox environment, etc. You can build package from source or download from a binary cache. You can modify configure flags and other build settings and the correct packages will rebuild - or download from cache if they are built with the same flags. It installs easily on top of other Linux distros.
- vcunat 13y agoI'm happily using it for years already, and for me it's mainly a great step forward in freedom to experiment. You can do almost anything without touching virtualization, and even in bad failures you can simply choose your old stable config in GRUB whenever you need a working system :-)