5 ms·
So with NixOS your process would look like this. Open up your editor on one of your devices thats already running. Write up a nix config that sets up i3 and fir
by tinco 7y ago
So with NixOS your process would look like this. Open up your editor on one of your devices thats already running. Write up a nix config that sets up i3 and firefox, could be just a couple of lines. Save it on a usb drive along with nix itself. Boot your new pc off the USB drive and your set.
And thats just the first time you use nix. Next time you just reuse that thumbdrive, or redownload it, and get your config from a git repo you are tracking your config in.
I have a git repo that has configuration for three types of devices I run in my personal setup (desktop, nas, webserver). They all inherit from my base configuration which has stuff like the user configuration and maybe my vim how I like it. The server adds docker and runs the docker containers that it should. The nas mounts the raid array etc.
If I want to know how I configured my nas three years ago, all I have to do is read the nix file I checked onto github. Thats powerful.
- rustybolt 7y ago> 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.
- tinco 7y agoWell 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.
- abrouwers 7y agoI 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.
- tinco 7y agoPeople 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.
- takeda 7y agoAgree, 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
- majewsky 7y agohttps://nixos.org/nixos/options.html 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.
- na85 7y agoWhat'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.
- elbear 7y agoThe 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.
- strunz 7y agoHonestly, 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.
- agumonkey 7y agodocker is like nixos for 2yo
- peanut_is_yum 7y agoIf that were all there were to it, I would certainly prefer docker over nixos
- TheYumasi 7y agoIt’s just a matter of doing a good old `man 5 configuration.nix`.
- qqssccfftt 7y agoWhy would you want to know how you configured your NAS three years ago?
- eximius 7y agoIf you were happy with it and need to do it again? If there were small gotchas you aren't eager to rediscover?
- tinco 7y agoRan out of disk space, want to run another service, want to check if there's any software updates.. I don't know, in my case I had it in a moving box for 1.5 years and I was pleasantly surprised it even booted and immediately started serving up stuff to my TV.
- m463 7y agothat actually sounds WONDERFUL. I had a machine that I let run with an old (private) certificate for years because I didn't remember the how and the what of renewing that specific certificate. I had another machine that had a hardware failure, and I spent an enormous amount of time recreating it.
- takeda 7y agoI have been running a personal server (FreeBSD) for close to 20 years now, and upgrading in place since 4.6. And once some hardware components fails (especially disk) I spend extra time figuring once again how I did it then. Having everything described in a configuration would take less time to do such fixes.
- kylek 7y ago>> If I want to know how I configured my nas three years ago, all I have to do is read the nix file I checked onto github. Thats powerful. Have you had to deal with breaking changes in the config language? (Does this ever happen? Are there versions/specs of the language that can be pinned?)
- tinco 7y agoI don't remember any changes in the language, but I did encounter packages that had their configuration renamed or changed in a way that broke my config. Basically you pin to a version of NixOS, and opting into the next version is fully optional. So if you change your NixOS version, and you run nixos-rebuild, and stuff doesn't work, then you can just undo your change. NixOS even keeps a backup of itself ready, so say for some reason you update but your new version doesn't boot, you can simply boot into your previous working version.
- takeda 7y agoSo nix has ability to pin to specific version and you can get exact same system. With an OS there is a problem, because most of the time you don't want to do that, you want to get security patches and erratas. For this purpose channels are used. They promise to not break anything within release channels. This is very similar to how other OSes, you need to trust them to not break thighs. There is also option to subscribe to a rolling release, so similarly to other OSes there are more opportunities for things to break (living on the edge and all), but the stuff below still applies. On top of that there is also variable in your configuration.nix it is set to the version of NixOS that you first installed. That version is version of the configuration file and supposed to guarantee compatibility. The compatibility they mentions are things like for example default version of PostgreSQL that they use if you choose default one you don't want on system upgrade to automatically force you to upgrade your database. Another obvious change is change of defaults, perhaps they decided that service that was previously enabled by default should be now disabled etc. You can bump the version in that file, but then you have to go through changelog and adapt your config to these changes. I am relatively new NixOS user, but just did uphrade from 19.09 to 20.03 and it went smooth as if it was just update within the same release.