Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It doesn’t matter which distro you use… unless it’s NixOS. Declarative operating systems are the future. NixOS is incredible. My whole configuration is a git repo. My servers have the exact same neovim/tmux/zsh config as my laptop. Switching between desktop environments couldn’t be easier. Messed up your system? Simply choose a previous generation on the boot screen. Seriously, try NixOS.


caveat: gargantuan learning curve. Expect to be learning a small yet slightly odd programming language and an ecosystem years in the making. As a distro it is strictly only useful for very technically minded people or people who rely on someone like that to maintain their distro for them.

But once you do learn it and fully prepared your set-up, it's amazing. Around a month ago I switched from Arch to NixOS after using the former for around a decade and I'm very happy with it despite its warts.


I agree that there is a large learning curve. It certainly took me a many months to get a good configuration repo going. But I see this as a failure of documentation rather than a failure of NixOS. The way I have my config setup is really not complicated, but it took so long to figure out the design. I really want to write a blog post series about how I do NixOS because I highly value simplicity and I think there are too many NixOS “learning” resources that are written by and for highly technical NixOS gurus. NixPills is a prime example of this. That blog post series is NOT for beginners. At all. But somehow is referenced as a learning resource.


Is your config on GitHub or are you on Twitter or something? I'd love to see what you came up with. I'd like to try NixOS but I don't have the time/motivation to learn something too complicated


My config isn’t open-source just because it’s pretty personal information. You would be able to see every database in my local Postgres instance for example. And every one of my servers. But I do plan on making a open-source version as an example soon. And some blog posts. On twitter I’m https://twitter.com/stelstuff. The blog posts will be on https://stel.codes. GitHub I’m https://github.com/stelcodes


I've also switched from Arch (has been on it for ~10 years) to NixOS (~1 year so far), and fully agree it's amazing.

I've been thinking how interesting it would be to create a user-friendly Linux distribution on top of standard NixOS (similar to what Manjaro is to Arch), which would not require learning Nix language or tinkering with the configs. I mean, system configuration/choosing packages/drivers/kernels should not really require a user to write in Nix language - the sane choices can mostly be represented by a set of GUI checkboxes. There also could be GUI utilities for other Nix goodness, such as creating nix-shells with necessary dependencies available, declaring wrappers for proprietary software, or building temporary VMs. So, I would say, the user absolutely does not need to know a lot about Nix to fully appreciate robustness of NixOS way, and in principle, with the right tools/GUIs it can be very approachable for even non-technical users - it's just that user friendliness seemingly has not been a priority so far.


Ive thought about this too! That seems totally possible. I think that’s such a great idea. It could truly bring Linux to the masses!


I wholeheartedly agree, and I am a giant NixOS fan, BUT:

1. You need space for the Nix store, so it's not appropriate for every system (I like building small embedded appliances).

2. A six month release cycle can get a bit tiresome after a while. I know it's personal preference, but I wish it was a bit longer.

3. Or, in order to contribute to the project, you need to chase the dragon with the unstable channel.

4. Forcing all the system state through the funnel of a single config file is great, except that it doesn't cover home directories. I found that I ended up with a massive unmanaged blob of state in my home directory which I couldn't capture (I never tried out home-manager, maybe I should have).

This is not to detract from NixOS! NixOS is great, and I remain a massive fan :-). But on my personal systems I find myself using macOS and Debian these days. ¯\_(ツ)_/¯

EDIT: Line spacing


Valid points. I definitely wouldn’t use NixOS on embedded. About contributing, You don’t really need to be on the unstable channel completely. I use a mix of stable and unstable packages. It’s not hard to do but it’s also not super intuitive either. And about home directories, I don’t use Home Manager either. I find that it introduced too much complexity and I don’t actually like it all that much. What I do is globally install all my packages and put configuration files in /etc. if the programs don’t have an /etc location to look for, I just create a symlink to config file in my home directory. That way all my config files are in my nixos-config repo.

I want to write a blog post about my way of setting up NixOS. There are many ways to go about it and I feel like mine prioritizes simplicity and doesn’t use complex Nix techniques, so it may be very helpful for beginners.


For 1., it's possible (easy even? I've never tried this in a cross-compiling situation) to build packages on one system and push them to another via SSH.

I suppose an upgrade would still result in two copies of everything, at least temporarily, but at least the target system doesn't need source code, compilers, etc.

https://nixos.org/manual/nix/unstable/command-ref/nix-copy-c...


> Declarative operating systems are the future.

Is there a version of this future where I don't have to learn a new language just to effectively use a computer?


Doesn’t every declarative tool require some new learned syntax? The Nix language is pretty damn good at configuration IMO. It is significantly less complex than python, for example.


If that is true, then I definitely don't want a declarative operating system to be my future. I'd rather have things designed simply and understandably than overcomplicate them in this way.


I used NixOS for years now and it would be my first choice for anything else, but I wouldn't use it for desktop.

Solus has that on lock for me and initially I didn't see it as particularly special, I too thought distros didn't matter much anymore. I thought I could switch away from it to any number of capable distros, but it never worked out and I returned to Solus every time.


I joke with a friend -- a serious emacs maven of 20+ years -- that he took up NixOS only because he was no longer daunted by emacs.

NixOS looks neat, but holy hell I absolutely do not have the time to deal with the learning curve OR the implicit abandonment of all the tools I use to do my job.


Lol emacs is honestly too complex for me to dive into. I like vim because it’s simpler! I seriously value simplicity. And wanting to stay on whatever works for you, that’s totally fair. If it ain’t broke don’t fix it. The beauty of NixOS is that makes all the package management and configuration completely declarative and versioned. And includes a huge amount of options that abstract away complex Linux tooling, making things “just work” for 99% of use cases.


Can you bootstrap a NixOS installation via WiFi? I've been using Nix as a package manager, but I avoid distros like Arch that are (or at least were) a pain to install if you don't have an ethernet connection to bootstrap from.


I've installed NixOS over wifi a few times, most recently for a desktop that wasn't next to my router and that I didn't feel like relocating to connect via ethernet. The fully featured install ISO (not the minimal version) comes with a GNOME desktop environment and you can point-and-click to set up your wifi for the install.

However, a fun trick I learned recently is to tether your phone to your computer while installing any Linux distro. My phone's tether connection over USB just looks like ethernet (as far as I can tell), so there is less fiddling around. My Android phone can tether to my wifi as well, so no need to use your cellular data.


So NixOS is great for using the same setup between computers. What about for people with one computer? Is it still good? Is it as easy as Ubuntu?


Yes definitely good for one computer! And I really think that NixOS is simpler than Ubuntu but there are many different ways of setting up your configuration repo and that is difficult for beginners. The way I do NixOS is very simple. And I really want to make a comprehensive guide on how to do it my way because it’s so nice! But I had to wrestle with it for many months to get to where I’m at with my config repo.


Is it equivalent to initialize Git repository in $HOME ?


No. It replaces the FHS with a whole new vision of how the OS is arranged and managed.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: