21 ms·
NixOS Linux
- bluejekyll 11y agoI'm really intrigued by NixOS, but I have to wonder if it's too much too fast, and the Atomic project isn't a better stepping stone.
- r0naa 11y agoI have been thinking about switching to NixOS because of the great things I keep hearing about it. I would enjoy reading reviews from HNers, has anyone used it as a desktop?
- tormeh 11y agoDidn't even install for me. It's for tinkerers currently, I think. I basically wanted an Ubuntu that didn't deteriorate with time, so I guess I'm not the target audience.
- sergiosgc 11y agoLooking for an ubuntu that didn't deteriorate, I switched to debian sid two years ago. Sid is a rolling distribution, so there are no releases. It's not that it does not deteriorate. Instead, it deteriorates at a rate that allows me to fix things as they break. Mind you, I used Gentoo for many years before ubuntu, so I'm used to rolling breakage. Sid is a lot more stable than Gentoo (circa 2010)
- tormeh 11y agoThat's interesting. If I never fixed anything, how often would I need to reinstall? I'm currently considering turning off updates on Ubuntu and just reinstalling every time there's a new release. I'll probably switch to Windows, though, as I don't expect to code much on my home computers now that I'm no longer a student. Coding on windows is hell and the DE sucks, but windows is stable and has a lots of software available.
- ossreality 11y agoWhy the fu ck would you do that?
- marcosdumay 11y agoI use Debian stable, dist-upgrading only a few weeks after each release. Kernel modules are the main things that deteriorate, mostly the GPU support. It's normally a matter of changing the kernel version (I freeze the kernel every time I remember about it) or removing some old package that isn't permitting a clean upgrade. Last time I reinstalled a desktop was in 2007 (I had 3, now I only have 2), because a Windows machine got a virus at the same LAN, and I wanted to be sure it didn't get anywhere. Last time I reinstalled a laptop was during the setup of my new one, this year, because I got a pretty messed-up set of kernel packages, and decided it were easier to just start from scratch.
- sergiosgc 11y agoNo idea. The thought of having something break, and not fixing it immediately, escapes me. A properly maintained Linux install goes down with the hardware. It was like that with Gentoo and my Thinkpad R40, then the X61T used various installs of Ubuntu, and now the X1 Carbon has the same sid install for a couple of years, and it will last a couple of years more. Ubuntu solemnly annoyed me by botching every upgrade and forcing me to reinstall every half-year. It was window-esque...
- xiaomai 11y agoNix is awesome. The last time I ran it stuff like gnome-shell wasn't packaged, which made it hard to use for a desktop (they did have a number of window managers packaged though). That's the hardest part about nix right now (the lack of packaged software). It is pretty easy to write your own packages for basic software though (and the Nix project is good about taking pull requests). Looks like gnome3 is packaged now, I'll have to give it another shot: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/x11/desktop-managers/gnome3.nix https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/s...
- yellowapple 11y agoI ran a NixOS desktop VM for a little while to familiarize myself with it and eventually be able to tackle learning the server side of things. It's very different from a normal GNU/Linux, that's for sure.
- ebzzry 11y agoWe're using it for servers, laptops, and desktops. I'm using NixOS now on bare metal to compose this message. The system is built like a rock. And oh, managing just a single text file to configure everything is a big plus. I highly recommend it. :-)
- corobo 11y ago> just a single text file to configure everything is a big plus What ever happened to Linux folks mocking Windows' registry from back in the day :)
- ebzzry 11y agoHeh. At least, we don't have to have Carpal Tunnel Syndrome (CTS) anymore navigating down the registry tree. It's a completely different story though, if one is going to edit the complete .reg dump, and import the settings from there.
- agumonkey 11y agoThe windows registry is a tad more complex. It's funny a while back Arch main selling point was single point of .. config too. Now it's systemd fine grained graph of .service. But nix being built by language designers, I guess abstraction and reuse will stay baked in.
- digi_owl 11y agoThey recreated it 20 times over in the name of modernity.
- davidrusu 11y agoNixOS is really nice, what I enjoy most about it is it gives you the tools to be explicit about the state of your system. We know that implicit state and mutation are terrible in the programming world why not extend that philosophy to your entire OS? You might be missing some packages so make sure to check this: http://nixos.org/nixos/packages.html http://nixos.org/nixos/packages.html before installing. It's still early for NixOS, the OS is solid but it's likely you'll need to package up a program or two (but it's not difficult)
- imsofuture 11y agoYep, I echo this experience. It is my main desktop OS, I am very happy with it. Myself + another developer at my company both use it, and it's starting to gain interest from others, seeing as it's mostly a panacea to all sorts of environment and configuration issues. I was pretty unhappy learning how to write the strange config language at first, but I've made my peace with it. You will almost certainly need to write a package or two, but there's a lot of active development to learn from, and lots of example to cargo cult.
- bdimcheff 11y agoOther developer here. I've been running nixos as my main OS since about November after running Funtoo for a year or so before that. My tolerance for hacking on my distro is maybe slightly above average. ;) On the cool side: Nix is the first linux distro I've contributed to, because it's the standard "hack, fork, pull request" process that most github-hosted open source projects use these days. The biggest thing is that you absolutely have to drink the nix koolaid if you're going to run nixos. You can't really do the normal ./configure && make && make install, because paths to libraries are all non-standard. But once it all really clicks, it's pretty great. As far as desktop goes, the rest of this thread rings true for me too: most of the important things are there, like desktop environments, window managers, browsers, etc. There are occasionally niche/older packages that are not available. If you're willing to learn a little bit of nix language, it's relatively straightforward to add most packages.
- chriswarbo 11y agoI've been using it for nearly a year. One comment I'd make is that learning the nix package language will make life much easier. I've written a few thoughts about nix at http://chriswarbo.net/essays/nixos/ http://chriswarbo.net/essays/nixos/
- gosub 11y agoI've tried to install NixOS on an old laptop, for a minimal installation, there were some things I did non like: * Default packages are compiled with all the dependencies * The configuration language is a functional programming language, and that's a plus, but the syntax is quiet weird, not similar to ML, Haskell nor Lisp. * some command line tools are cryptic at best, for example searching for available packages is done with nix-env -qa \* -P | fgrep -i "$1"
- josteink 11y agoGetting it running on actual iron took more effort than I expected, but lately distros like Ubuntu has spoiled the linux-crowd. The hardest part about going all in is of you find some of the software you rely on not being packaged. There's just no way to "cheat" and ./configure && make'ing for way around: you have to learn the Nix language and package the software yourself. (Which can arguably be said to be a viral feature for getting more software packaged) To me this was too much work to fit in an otherwise busy weekend and I just had to give up. Had I had more time to do things properly, I would probably have stuck with it. The concepts it introduces are quite nice and well executed.
- tormeh 11y agoAt the start of this year, I tried to install various Linux distros on my laptop using a USB drive. Only Ubuntu and OpenSUSE worked. Why is this? Is the desktop really that irrelevant? This is not a bug report. I'm wondering what the institutional reasons are.
- sp332 11y agoDistros have to choose which kernel version they want. This can be a tradeoff for stability or new features etc. If they pick an older kernel, the decide which newer drivers they want to try to backport. Then they decide which drivers they feel like supporting and putting in the repositories, and which of those get loaded onto the installation media. Some distros might have closer relationships with specific vendors and have information about configuration details or workarounds. Laptops are notorious for using nonstandard hardware from niche suppliers and taking a lot of work to configure.
- tormeh 11y agoThanks
- robertfw 11y agoThis isn't really the best place for the question, and besides that you'd need to provide a hell of a lot more information for anyone to help you.
- shared4you 11y agoNixOS has been discussed many times on HN already. However, Nix 1.9 was released today (/yesterday for the some): Release Notes: https://nixos.org/releases/nix/nix-1.9/manual/#ssec-relnotes-1.9 https://nixos.org/releases/nix/nix-1.9/manual/#ssec-relnotes... Downloads: https://hydra.nixos.org/release/nix/nix-1.9 https://hydra.nixos.org/release/nix/nix-1.9
- chriswarbo 11y ago> nix-shell can now be used as a #!-interpreter. This allows you to write scripts that dynamically fetch their own dependencies. For example, here is a Haskell script that, when invoked, first downloads GHC and the Haskell packages on which it depends: Wow, that sounds super useful! I'm finding more and more default.nix and shell.nix files scattered through my hard drive, along with wrapper scripts for invoking nix-shells. I can probably replace a lot of these with appropriate shebangs :)
- mateuszf 11y agoThis is a great idea. It would be cool if Docker supported something like this.
- marcosdumay 11y agoHas anybody here got the experience of running NixOS in production or on the desktop (as the main OS, not in a never booted partition)?
- cwp 11y agoYeah, I've been running NixOS on production servers for about a year. I'm at a small startup, so it's not huge scale (yet!) but it works great.
- marcosdumay 11y agoGot any problems with package availability? I imagine those should be very easy to fix, is that true at daily use?
- cwp 11y agoAll the packages I need have been part of nixpkgs, except for node packages from npm. For those, I run npm2nix to generate nix expressions from the package.json files. That's occasionally tricky when npm packages do "clever" things that don't work when translated to nix. Generally, though, npm2nix works pretty well. I also have about 3K lines of nix code for packaging my apps, configuration, cluster definitions for nixops etc. There's a bit of a learning curve, but I find it really pleasant, now that I have the hang of it.
- Nullabillity 11y agoI've been using it on my HTPC for a while. Getting it to work for a relatively exotic setup (boot into Kodi, still allow admin logins, mount NFS media shares on boot) was a bit fiddly, but once it worked it's been great. The one concern I have is that it was pretty happy to recompile Chromium all the time, but switching to Firefox made it more bearable.
- vdijkbas 11y agoAt LumiGuide we use NixOS on our development machines as well as on all our production servers. I used ansible before but NixOS is on a whole different level. See the following for a story about a system we just deployed which uses NixOS: https://news.ycombinator.com/item?id=9690683 https://news.ycombinator.com/item?id=9690683
- millstone 11y agoI'm intrigued by the "atomic upgrades and rollbacks" claim. Let's say that deploying a package requires placing two files somewhere, e.g. vmlinuz and initrd. How can this be done atomically?
- sp332 11y agoThe package manager could just flock() a specific file before making any changes.
- millstone 11y agoFrom svn's red book: By atomic transaction, we mean simply this: either all of the changes happen in the repository, or none of them happens. Subversion tries to retain this atomicity in the face of program crashes, system crashes, network problems, and other users' actions. Does Nix mean the same thing? Is it atomic in the face of program or system crashes?
- cwp 11y agoYes. In many cases, switching to the new version of the package is nothing more than rewriting a symlink. Sometimes it's more involved, like restarting a service. Either way, the cut over happens after building the new package has completed successfully. If building the package fails, it has no effect on the running system. I suppose there is still a window in which an error could leave the system in an inconsistent state, but it's pretty narrow, and the error would have to be a kernel panic or something like that.
- millstone 11y agoErr, are there any systems that try to cut over to a new package before it's been built successfully?
- thrownaway122 11y agoI guess that traditional package managers could install a helper script or a config file early in the build system before the main package is finished.
- _RPM 11y agoIs this proprietary? I can't find a link to the source anywhere.
- ebzzry 11y agohttps://github.com/NixOS https://github.com/NixOS
- _RPM 11y agoThat doesn't have the source code to the operation system on here. So, agin, I ask, is this damn thing GPL'd or is it on some prop. bullshit?
- davidrusu 11y agoIt does, but it's not in it's own repo, it's in nixpkgs at https://github.com/NixOS/nixpkgs/tree/master/nixos https://github.com/NixOS/nixpkgs/tree/master/nixos
- sondr3 11y agohttps://github.com/NixOS/nixpkgs/tree/master/nixos https://github.com/NixOS/nixpkgs/tree/master/nixos If you had bothered looking in the wiki everything is listed there.
- iamcurious 11y agoI have been using it for a while as my main OS. So far it has been great. There are a few warts, like any distro, but with NixOS the fixes tends to get written in the main configuration file, instead of scattered among many files. That meant a lot when I had to install it in another machine. 1) Install NixOS with my configuration file. 2) Copy dot files to home 3) There is no step 3) !
- dmix 11y agoHow have you found package support? The quality/breadth of packages available in ArchLinux AUR would stop me from using any other distro. Arch's primary package set contains the standard set - which I assume is similar to NixOS - but all of packages requiring tricky/custom configuration tend to be in AUR. Which has saved me on a number of occasions from having to follow pages of tutorials that you'd normally have to follow in order to install things when using Linux for a desktop. For example, setting up nice fonts with great default settings in Arch is a single AUR package away.
- asddubs 11y agoArch is great. The only reason I switched away from it were the occasional manual intervention updates which could just mess up your system if you weren't paying attention.
- lallysingh 11y agoEventually I kept the install ISO on a USB key for those situations. My main issue is how often I felt like I had to update.
- gcb0 11y agoand here i am on debian stable. always complaining i can't update often enough. But thanks to comments like this i'm happy again :) good news is that it will be some 4 years until i have DRM on firefox... i mean iceweasel.
- 11y ago
- krick 11y agoMany people pointed out that NixOS has been discussed here many times already, but nobody mentioned Guix, so here it is, for reference: https://news.ycombinator.com/item?id=9127679 https://news.ycombinator.com/item?id=9127679
- davexunit 11y agoSee also GNU Guix and the associated distro GuixSD, which is based on the same underpinnings of NixOS: https://gnu.org/s/guix https://gnu.org/s/guix
- technomancy 11y agoI'm much more interested in guix since it has all the same upsides but uses scheme instead of a weird NIH language, and it also has some standards when it comes to the licenses of the packages. (Nix disappointingly gives you the Adobe Flash plugin when you ask it to install Firefox, etc.) Still grateful for the solid foundation Nix provides.
- davexunit 11y agoCome join us for a hack sometime. It would be cool to get some of your elisp projects packaged.
- chriswarbo 11y ago> it has all the same upsides but uses scheme instead of a weird NIH language The packaging language is great, but I agree that it would make more sense to embed it in an existing language like Scheme. Is guix compatible with nixpkgs, or do all package definitions need to be translated into scheme first? > Nix disappointingly gives you the Adobe Flash plugin when you ask it to install Firefox, etc. Really? I've had Nix refuse to install stuff, telling me to override the "allowUnfree" option if I want it to work (this happens when a Haskell project doesn't specify a license in its cabal file, for example). I use NixOS, so maybe the defaults are different from standalone Nix.
- davexunit 11y ago>Is guix compatible with nixpkgs, or do all package definitions need to be translated into scheme first? They have to be translated into Scheme, but we have a 'guix import nix' tool to assist in that.
- technomancy 11y ago
- nickpsecurity 11y agoI just commented on one IT segment not learning from the past. NixOS deserves praise for doing the opposite: seeing various problem involved, identifying proven ways for solving them, and implementing them into a usable solution. Combining declarative and transactional properties into the package system as effectively as they do is very smart. I hope to see more distro's follow suit.
- vezzy-fnord 11y agoI agree wholeheartedly. However, I sincerely doubt most distros will adopt it, for the simple reason that unifying the packaging infrastructure means more-or-less obsoleting the concept of a distribution.
- deleted 11y ago[deleted]
- nickpsecurity 11y agoWould it, though? Wouldn't a distribution just become a specific configuration of source, binaries, and other data?
- regularfry 11y agoA "distribution", at its core, is simply a (nominally curated) collection of software which works well together. The packaging system is, or should be, a red herring.
- nodivbyzero 11y agoIs it better than ArchLinux?
- agumonkey 11y agoSimilar effort in debian : https://wiki.debian.org/ReproducibleBuilds https://wiki.debian.org/ReproducibleBuilds (one of the project lead, https://people.debian.org/~lunar/blog/ https://people.debian.org/~lunar/blog/, is a haskeller, so no surprises) Read his blog, very interesting to see how tiny things matter.
- thoughtpolice 11y agoIt's worth clarifying this a bit because there are a lot of subtle implications about what it means to be 'reproducible' or 'deterministic'. To make the terminology clearer, I like to use the term 'deterministic' vs 'reproducible'. A deterministic build is one which, if it works, will always work, and follow the same steps. A reproducible build is one that you can reproduce identically, down to each individual SHA1-hash. This is what Debian has spearheaded, and what they mean by 'reproducible build'. At the moment, Nix packages are deterministic - but they are not reproducible. If I have a specific git revision of nixpkgs (the repository containing all package descriptions), and I say 'install mutt', I'm guaranteed that I will always get the same build results. No matter when/where I do it. That means I'm always going to get mutt version x.y, with dependencies A, B, and C, all with their own exact versions, and features enabled. The same optimization levels. The steps the compiler uses to build everything will be the same, etc. You can essentially think of a 'nix expression' as a program that gets compiled to a shell script, which does a build, and you run the shell script. So if you have git revision DEADBEEF of the 'nixpkgs' set, and you 'run the compiler', so to speak, to generate a 'builder' from a Nix expression - it seems very obvious it will do the exact same thing, every time, regardless if you run it today or next week. The thing is, this is a pretty nice property. In Debian for example, if I 'apt-get install' something, I may not get the same program if I do it today and then do it tomorrow, because it may get updated. This, in practice, is kind of a big deal actually. It means it's impossible (unless you use your own mirror) to actually have things like prod/development environments the exact same without imaging them like Docker. And of course, this makes rollbacks impossible because the set of packages on your system is really a bunch of mutable variables. For example I used to do security research, and it was a massive pain in the ass when I would try to 'apt-get install' mysql and get a patched version already. I needed to write code to find this vulnerability, AND I want to regression test that code in the future. But I can't. It makes it very hard to do things like write automation to make sure you can detect if mysql is vulnerable (because where will you get the pristine package you originally tested with?) Similarly, because of this property, you can be sure a developer's computer is exactly the same as a production or staging environment for example. Because the 'state' of your whole computer is really a function of two arguments - a function of your configuration.nix and your nixpkgs package set. This is what it means to be a 'purely functional' distribution! But the builds aren't reproducible yet. There's all kinds of actual 'non-determinism' in the build process for any one specific project that makes bit-for-bit reproductions difficult. For example people use `__DATE__`, or they do weird things like rely on build mtimes, or other crazy stuff. Debian has tracked tons of these down - so it's doable! There is a branch of Nixpkgs that aims to fix this. Hopefully it will be solved for NixOS 15.10.
- thrownaway122 11y agoDoes this not lose the major advantage of a traditional package manager? Namely that I update openssh in one location and all my packages are now secure. Rather than having to update every package that depends upon openshh separately?
- ambrop7 11y agoGenerally, all packages depending on that library will need to be rebuilt. But that is automatic when you do an update, it just may take time (either for packages to be rebuild locally, or by the build farm if you're using channels). But you can manually do a hack to substitute a patched version when you want the fix right now: https://nixos.org/wiki/Security_Updates https://nixos.org/wiki/Security_Updates
- lobster_johnson 11y agoNixOS would be awesome on the server, but I'm worried about security updates. Debian/Ubuntu have a lot of resources and protocols set up for this; for users like me, I can follow the mailing list where every package updated with security fixes is announced, and the updates seem to meticulously follow announcements about known vulnerabilities. How is NixOS in that regard?
- Profpatsch 11y agoI have been writing a guide on how to set up a desktop system with NixOS, but I’m not quite finished yet. I wonder how high the interest in something like that would be? I can throw up an unfinished beta version of it if people are interested.