> Write up a nix config that sets up i3 and firefox, could be just a couple of lines
You forget the step "find out what to write in the nix config file". Might take anywhere from less than a minute to forever, depending on experience, google-fu, and documentation.
Well obviously, I'm just pointing out why you would want to spend some time figuring it out. NixOS isn't just another linux distro, it's the next generation of operating systems.
I don't know, the "benefits" have been well preached for years, and I don't see NixOS gaining popularity (though, I tend to focus on the linux community news, so might be missing the visibility). To me, NixOS is a cool concept, but I think it solves a problem that not a lot of people have. I mean, how often are people "redoing their systems from scratch," deploying to new machines, etc? That's like a once-every-four-year thing for me, and it's way easier to just dump a list of packages.
People mostly don't have the problem because Ansible et al solve it for them. It's the classic situation of a good-enough solution existing, making the superior solution irrelevant.
Agree, what is going for Nix is that is a valuable tool and is very versatile. NixOS is just one application.
From OS point of view you no longer need:
- Kickstart
- Ansible, Saltstack et.al.
- Custom package repo for custom packages (if you need to customize something)
There are other areas too:
- create common developent environment, makes sure every developer has exactly the same tools installed with exactly same versions, so no more "it doesn't work on my machine"
- build system
- CI/CD
- packaging (as mentioned, you no longer need artifactory, instead you can have nix cache)
- there is also potential to use it for IaC, there's NixOps, but currently this is maybe the weakest part of Nix, it only covers deploying a box, but if you want to do something more complex, like autoscaled service it gets in the way. It is great for developing a new image though. There are terraform integrations, I didn't try them yet, might work better.
- you can configure local developer machine to use build system for local builds as well. If caching is configured, then once code is deployed it will already cache good build so it doesn't need to redo it
- for personal use with things like home-manager it can replace dot files as do more, you can have the same environment each time. Let say you change job and get a new laptop you can have it quickly set up the way you want it
https://nixos.org/nixos/options.html massively helps. Sure, some things you have to build for yourself and that may take some time, but a surprising amount of stuff has been done already and you just need to flip one of these options to activate it.
What's the value proposition over something like Debian where it Just Works(tm)?
Maybe if I was a sysadmin managing a herd of boxen I would like this, but for a guy with only two Linux systems (plus my mac, plus my windows boxes, plus my openbsd pcengines etc.), it seems like a lot of fuckery with text files for little to no actual improvement in my UX.
It's the same as with git. Some people don't use git when they're working on a project solo. I don't get that at all, NixOS is a fundamentally improved way of managing your operating system. The only real reason not to use it is because you're in a company and your business needs to avoid risks like sysadmins not getting your tech stack, or some component not working because there's a bug in a less battle-hardened setup.
When you're solo there's no such restrictions, you can just use the nicest tech that's out there. I've been amateur-adminning debian/arch/ubuntu machines for 15 years now, NixOS is such a relief to be rid of that mess.
I can actually remember what's installed on my system and how it's configured in a centralised place, even when I don't touch the configuration for a few months. It's actually better for "boring" systems that I don't touch the config of much - "why is that set up like that" is a question I can easily answer. Additionally, when I do want to play with new stuff, the various tools I'm given usually let me do that and go back to a clean slate if I'm not interested, without having to deal with heavyweight containers/VMs/etc.
All your state is in one place - packages and configuration. On a typical system there is tons of hidden state - some little option you had to change but didn't document, some package you forgot you installed ... that's not that easy to reproduce or change-track without backing up the whole system. You could use Ansible to do it, but that's another can of overhead.
I am sorry but that is fanfiction that nix people want to believe. There are numerous reasons not to use nix, a few:
- Incredibly smaller community
- Incredibly smaller support from community and enterprise
- Yet another programming language - that is difficult to grok
Those alone can kill any technically sound project, but there are lots of others. Such as slow installs, storage requirements etc.
The main value proposition is this:
With a single file, you describe the desired state of your system. That file is configuration.nix.
You put in there what packages you want installed, what users, what SSH keys, what services systemd manages.
Then, you run `nixos-rebuild` and then you switch your system to that configuration. The old state of your system stays around until you run garbage collect. So you can rollback to it, if you want.
>Then, you run `nixos-rebuild` and then you switch your system to that configuration. The old state of your system stays around until you run garbage collect. So you can rollback to it, if you want.
How often are people doing this, though? I get a machine set up pretty quickly (install list of packages, systemctl enable <foo bar baz>, reboot), and I'm set for several years.
It is as often as you change things. Also configuration.nix isn't just a list of packages to install and services to enable, it's also a configuration of various system components.
I'm quite new to NixOS and recently tried home manager, which basically manages your home, primarily all dot files, but goes as far as preinstalling favorite extensions on Firefox for example.
Kickstart is just RedHat equivalent of unattended install. NixOS goes way beyond that it also takes over CMS (ansible, saltstack, etc). You can for example modify one of packages (use different configuration option, or maybe sorry patch) and if binary version is not available in the cache it will compile new one. With home manager, it can also take care of your home directory, all configurations so called dot files, down to what extensions you want to have installed on Firefox.
Honestly, I find it infinitely easier to just do everything in in docker containers. Then the OS doesn't matter except for installing docker, and running docker-compose up.
Docker is for containing the environment of your apps. NixOS is for configuring your operating system. I use NixOS to define which Docker apps run on my machine, as well as monitoring and administration tools, firewall setup, that sort of thing.
If all you do is apt-get install docker, that doesn't feel like a very complete set up to me.
I'm saying if you run all your apps in containers, there really isn't much left to configure on the OS. Using Ansible for those few things seems like an easier solution.
But Ansible is an incomplete and extra part of software just to make your operating system behave like you want it to. Why not just pick an operating system that behaves like you want it to from the ground up?
Yeah, that argument is weird. If we are taking about state the difference between those two is that docker is just storing a snapshot of a state (BTW Dockerfile by itself is not reproducible and is comparable to a bash script) while Nix is storing information how to get to a given state.
That makes it far more versatile. It is what Docker promised to be, but ended up being an overglorified zip file. Depending on your needs, that might be all you actually want. If you want to make small adjustments to existing state (let say applying a patch, in docker you pretty much have to rebuild from scratch and with non-deterministic Dockerfile you might change more than that), or maybe compose something new from existing components, Nix gives you far greater control to do that.
Yes, the Dockerfile has serious shortcomings and makes it totally miss the mark on what it was promising, but based on some comments about how nix is hard, it probably helped with adaptation.
Seems like it comes much easier to most people to issue series of (often nondeterministic) commands that mutate state rather than learning a new language that allows describing dependencies and have it figure out steps needed.
Yes obviously docker is primitive and people prefered that, just like they prefered php4/wordpress, it was the right match for a nascent space/market.
The issue to me is that it's mostly a regression and that when showed nix/guix people would squint saying it's horrible.. when in fact docker way is horrible, it's just nicer to them.
You forget the step "find out what to write in the nix config file". Might take anywhere from less than a minute to forever, depending on experience, google-fu, and documentation.