top | item 5727459

NixOS - Declarative configuration OS

244 points| wamatt | 13 years ago |nixos.org | reply

75 comments

order
[+] foohbarbaz|13 years ago|reply
This is a move in the right direction:

=== On NixOS, you do not need to be root to install software. In addition to the system-wide ‘profile’ (set of installed packages), all user have their own profile in which they can install packages. Nix allows multiple versions of a package to coexist, so different users can have different versions of the same package installed in their respective profiles. If two users install the same version of a package, only one copy will be built or downloaded, and Nix’s security model ensures that this is secure. Users cannot install setuid binaries. ===

Requirement to be administrator to install software is the root of all evils in managing OS.

As far as keeping everything in a special location (/nix or whatever), this reminds me SCO OpenServer 5: they had all the files somewhere in /var; /bin, /sbin and everything else were just symlinks. It did not work all that well.

[+] dEnigma|13 years ago|reply
>[...]the root of all evils[...]

Pun intended? ;)

[+] alcidesfonseca|13 years ago|reply
Why did it now work all that well in SCO OpenServer 5?
[+] gnoway|13 years ago|reply
It was mostly in /opt, although there were also some things in /var.
[+] binarycrusader|13 years ago|reply
Some of the ideas seen in NixOS can also be seen in the Image Packaging System (Atomic Upgrades, Reliable Upgrades) project: https://java.net/projects/ips/pages/Home

Disclaimer: I'm also one of the IPS authors, so I agree with some of NixOS' ideas :-)

[+] davorak|13 years ago|reply
I read one article and skimmed the other under "Background reading" but I could not spot what the core philosophy or mechanic of how you are producing atomic and reliable upgrades.

I try to stay abreast of package systems which have the same or close feature set as nix. If you have a moment to explain the core mechanic or a reference it would be much appreciated.

[+] noonespecial|13 years ago|reply
We seem to be heading for a future where every application is run in a virtualized OS, configured and launched on demand.
[+] PommeDeTerre|13 years ago|reply
The future you describe is the distant past for many of us.

We've been using chroot, FreeBSD jails, Solaris Containers, and similar technologies for many years now. Combined with the basic functionality of UNIX and UNIX-like systems, we can quite safely isolate users, apps and data, but without the overhead and inconvenience of heavy-weight virtualization techniques. Even then, these techniques are quite new relative to what's been available to mainframe users for many decades.

[+] skrebbel|13 years ago|reply
We seem to be heading for a future where the only application run locally is a web browser.
[+] yowmamasita|13 years ago|reply
This "Multi-user package management" is a really neat feature, I wonder if there are other distro's having that.
[+] lholden|13 years ago|reply
GoboLinux works in a very similar manner, though I'm not sure the distro has seen any love in a few years.
[+] drdaeman|13 years ago|reply
I've read dpkg has `dpkg -i --force-not-root --root=$HOME/.local package.deb` options, but I haven't ever tried those myself.
[+] GigabyteCoin|13 years ago|reply
After playing around with Arch for the last few weeks, this is incredibly interesting to myself.

Does anybody have any experience/testaments to post about this OS?

[+] davorak|13 years ago|reply
Sure, nixos is very forgiving to experiment with because you can easily rollback to a pervious configuration. Modify a library and something stops working fixing it is as simple as `nix-env --rollback` for a user package and `nixos-rebuild --rollback` if something was changed with the system configuration a restart may be needed if some systems are touched but it has not happened often and when it is needed it is specified.

I enjoy how easy it is to set up different profiles with different sets of libraries/compilers for development.

It has made it worth while to try out old libraries that only work on old compilers. It also made it easier for me to test against the HEAD of the complier repo for testing forward compatibility or new compiler features.

Since everything is nicely encapsulated once I have an environment working on my laptop I can use `nix-copy-closure` to move it to another remote server. `Nixops` a more recent offering just renamed from `charon` also allows for deterministic building of ec2 instances.

[+] jrn|13 years ago|reply
took me a while to figure out. nix-env -qa * | grep "package you are looking for" nix-env -i "package"

need to add different channels if you are grabbing packages from places other than nix-pkgs.

I had a hard time, getting some haskell packages to work, because nixos symlinks all the binaries, and there was some encryption library dependency, hard coded in a cabal file, and it was a headache/ gave up.

Eelco also provides a pathelf utility for modifiying dynamic linker in elf files, I haven't used it.

I'm on ubuntu again but I can't remember why. Oh ya, I couldn't get Blackberry's SDK working on nixos. Anything that doesn't go through nix-pkgs, will take some work. I didn't get to the point where I was writing nix-expressions.

[+] edwintorok|13 years ago|reply
If you run it in a VM (KVM/QEMU) you might need to set some CPU flags for the VM (otherwise GMP will assume your CPU has some instructions that it doesn't actually have in the VM): https://github.com/NixOS/nixos/issues/120#issuecomment-14776...

Other than that it works fairly well (in a VM), and you don't need to wait for it to compile all the packages like with Gentoo: if the build server has a binary then it will download that.

[+] snowpalmer|13 years ago|reply
The way they install multiple versions of applications and manage the dependencies reminds me of GoboLinux. I like the direction of this. Really like how they named everything though in Gobo.

http://wiki.gobolinux.org/index.php?title=The_GoboLinux_File...

[+] gw|13 years ago|reply
I remember playing with Gobo several years back. Although renaming system directories makes it a bit more approachable to newcomers, it also makes it less language independent and less recognizable to the users who typically need to use it (sys admins and such).

However, the general idea of installing things in a self-contained directory was fantastic, and I'm happy to see another operating system trying something similar. I used to use PC-BSD regularly, whose package manager also does this:

http://www.pcbsd.org/en/package-management/

[+] topbanana|13 years ago|reply
I'm not a Linux expert, but it seems some dependency issues won't be resolved by this e.g. Glibc conflicts. Or would it?
[+] davorak|13 years ago|reply
Is there something special about glibc conflicts that goes beyond normal versioning conflicts?

Package A could depending on glibc-2.13 and package b could depend on glibc-2.17. No conflicts would because by both running at the same time.

[+] qznc|13 years ago|reply
Rhe Red Hat/Fedora package manager yum also provides a rollback mechanidm. No user installation, though.
[+] davorak|13 years ago|reply
Does it also provide multiple versions of the same package running side by side? That is one of the more useful features of nix to me.
[+] durbatuluk|13 years ago|reply
I tried this distro 2 times since I heard of this rootless package administration. I give up because of poor documentation in both situations. I would love to see this approach in arch or gentoo (without the butthurt of slots)
[+] davorak|13 years ago|reply
That is too bad it has worked fairly well on vmware for me. I have also enjoyed using the nix package manager on my macbook as well.

The documentation can be lite on examples but it is very forgiving distribution to experiment with and I do not see to bump in to corner cases as often as I have on other linux flavors/package manager.

[+] yarou|13 years ago|reply
Having installed NixOS over a year ago, I was really impressed with the package manager. It's wonderful to be able to have multiple versions of GCC, haskell, etc side by side, so you can debug some of the reasons why your program works in one user's version/environment but not the other's. The actual papers are an interesting read as well.
[+] subprotocol|13 years ago|reply
Interesting, sounds like puppet/chef at the OS level.
[+] jacques_chester|13 years ago|reply
I've long suspected that something like this was the logical end point. Ever since I found myself writing a Puppet manifest that created an Upstart entry.

Configuration engines have tended to emphasise bits-at-rest. "Make sure these packages are installed, that these files are present, that this is what's in /etc".

Process management engines emphasise bits-in-flight. "Make sure Wordpress is running. Wordpress relies on PHP, nginx and MySQL".

Generally speaking, config engines assume that the bits-at-rest are correctly arranged to ensure correct runtime performance. And process management assumes that someone else has supplied the bits-at-rest which can be reified into an operational system.

Configuration engines tend to stray a bit into ensuring that software is up and running (eg, cfengine polls services every 5 minutes), but stop well short of the final conclusion of process management: insertion into the init hierarchy.

Why the separation? It's historical. Each local problem was solved in isolation (broken server config / crashing server processes) and they've each grown at the edges towards each other.

Just as ZFS collapsed several historical layers of file system tools into a single layer, it's been long overdue for the concept of defining a model of a system's various configurations with a detect-and-correct mechanism to be a universal framework that applies across an entire system.

[+] drivebyacct2|13 years ago|reply
KDE4? Systemd? Experimental? Centralized, versioned configuration? Sounds very, very cool. Worthy of being installed on something around here...
[+] mbell|13 years ago|reply
What linux needs is another package manager...
[+] zaphar|13 years ago|reply
Nix is an experimental Research OS exploring what you can do with a pure functional package manager. This is interesting. You are probably being downvoted because your comment looks like a poor attempt to cash in on the "What linux needs is another..." meme for some easy karma.

But let's take you at face value. Maybe you were serious in your assertion.

While Ubuntu, Debian, Fedor, Gentoo, and many other distros use very mature, robust and all around awesome package managers I still run into issues where a package is uninstallable because of some other package that it depends on is pinned, or the wrong version, or any number of other reasons.

Nix fixes exactly this problem while still maintaining many of the same benefits as the other package manager. So maybe Linux does need another package manager.

Or at least it needs people willing to play around with solving issues in the current package managers in a "research" setting perhaps?

[+] noonespecial|13 years ago|reply
What linux needs is a better package manager. I'm not convinced that the entire solution space has been explored yet so I welcome all newcomers.