Live data from Hacker News

NixOS and the Art of OS Configuration (2018)

rousette.org.uk

111–120 of 123 posts

Re: NixOS and the Art of OS Configuration (2018)

#111

Earlier quoted context omitted.

I'm not asking it to be more 'orthodox', I'm asking to not have to spend months scouring poor documentation to learn a new language and toolchain to gain the very few benefits Nix provides over the existing systems. If Nix is so inherently complicated it cannot deliver that, then why would I want it? Ultimately I want less complication in my life, not more, and Nix very much does not provide that from what I can see.

Nix operates at the cusp of some of the most complex and obscure parts of the technology stack: operating systems, compiler toolchains, and package managers. These inherently complex components require a fair bit of commitment to fully comprehend in order to be used well. You can get a lot of mileage skimming through some tutorials to become productive, but to really utilize it to its full potential requires a fair b…

> it is forced to break some old rules that date back to the oldest days of Unix and are (now) considered to be written in stone.

On the other hand, one of Nix's greatest strengths is that in many respects, its innovations are conservative. It brings software building and distribution forward in terms of reproducibility and isolation (like containers do) but (unlike containers) also retains the traditional package management virtues of granularity, efficiency, and sharing common resources (dependencies) when possible.

Re: NixOS and the Art of OS Configuration (2018)

#112
post #69

Earlier quoted context omitted.

I really like the idea of NixOS, but there not being a single clear guide of how to set everything up (and the messy documentation) is the biggest thing holding me back. I also really don't like wasting so much time on tinkering with my system the way I used to do. But I'm seeing so much Nix news these past few weeks, I guess it'll be better in a few years!

>I really like the idea of NixOS, but there not being a single clear guide of how to set everything up (and the messy documentation) is the biggest thing holding me back. Yeah this part is messy, and why I always disclaim that I had a learning curve of several months to make the transition. However, my system setup is a little more complex than the standard install - mirrored ZFS root drives on dual m.2 drives, with…

I should add, to be fair to NixOS and the team, that there are three main official documenation sections: Nix, nixpkgs, and NixOS:

https://nixos.org/manual/nix/stable/

https://nixos.org/manual/nixpkgs/stable/

https://nixos.org/manual/nixos/stable/

Anyone looking into transitioning to NixOS should take a leisurely weekend and just read through all three of those first. Being at least familiar with all of what's there will make getting up and running a lot smoother.

Re: NixOS and the Art of OS Configuration (2018)

#113

I literally just gave NixOS a go day before yesterday. The two things I noticed if you want to use NixOS as just a basic desktop setup was.. 1. It is simple and fast to install. People make NixOS feels like black magic. NixOS is easier to install than Arch linux. Just do 3 things. Partition your disk, create the nix configuration file and finally run the command "nixos-install" command. Let me explain with a lil more…

> It is simple and fast to install. People make NixOS feels like black magic. NixOS is easier to install than Arch linux. Just do 3 things. Partition your disk, create the nix configuration file and finally run the command "nixos-install" command. Step 2 is doing a lot of work here. It's pretty 'draw the rest of the fucking owl'.

> Step 2 is doing a lot of work here. It's pretty 'draw the rest of the fucking owl'.

Not really. Most distros aren't fully set up from the moment you complete a base install. Similarly, all you need for a base install of NixOS is to enable (1) a desktop environment, (2) a text editor, (3) a web browser, and (4) probably NetworkManager. In practice, this is a matter of uncommenting three or four lines from the template that nixos-generate-config gives you. Then after the install, you go about making everything comfy, just like with any other distro.

Re: NixOS and the Art of OS Configuration (2018)

#114
post #19

I recently made the switch to Guix, which is a distro heavily inspired by NixOS. It even has a Nix service[1] which is easily enabled to get the best of both worlds. Highly recommended! [1] https://guix.gnu.org/manual/en/html_node/Miscellaneous-Servi...

I wish NixOS had a Guix module built in, so any NixOS user could easily enable Guix on their system in the same way. :(

Re: NixOS and the Art of OS Configuration (2018)

#115
post #108
post #91

Earlier quoted context omitted.

Imo Home Manager isn't really about dotfiles. It's a NixOS-like module system for configuration unprivileged programs and services. You could use it, for example, to install and configure systemd user services for Emacs to run as a daemon, and for gpg-agent to run and work as your SSH agent. It lets you bundle specific versions of programs (with patches or configuration changes) in a declarative, reproducible way on…

BTW, there is a Firefox module in Home Manager for those who want a customizable Firefox. Like, I set my custom `about:config` flags there and every time I reinstall my system I am sure that I didn't forget that random config to enable hardware acceleration again. You can also manage extensions with it, but for this part I prefer to use Firefox Sync itself. At least for me, this is even better than backup/restore. Ge…

> At least for me, this is even better than backup/restore. Generally I don't want to preserve cache or cookies between installations, I just want my config there.

Yeah, I agree. NixOS even includes a module for easily hosting your own Firefox Sync server, too! So I guess in terms of use cases the solution is actually more or less complete.

Re: NixOS and the Art of OS Configuration (2018)

#116
post #97
post #86

Earlier quoted context omitted.

Luckily not [1]. 1: https://nixos.org/manual/nixos/stable/#sec-x11-graphics-card...

That's because someone already did the porting and testing for you. But what if you want the latest video and CUDA drivers?

> That's because someone already did the porting and testing for you

The same happens on all package managers...

Re: NixOS and the Art of OS Configuration (2018)

#117
post #109
post #85

Earlier quoted context omitted.

I think you can get going with little to no knowledge. Setup the system, choose a few cool options and packages, and go rebuild. Simple as that. The difficulty comes from the advanced topics. Modularizing your setup, writing your own packages, generally going off the beaten path. I did not do any of that (yet). I will in the future, but I am fine with my low-level setup. One machine, one user. A bit later I moved to…

NixOS' saving grace when it comes to the learning curve is that experimentation is extraordinarily safe, thanks to the declarative config and rollback functionality. If you don't know what you're doing, you can pretty painlessly get away with just fucking around.

Not just that. The ability to enter a sandboxed shell environment, play around with as many packages as you can get your hands on, and then exit back to my clean machine is my absolute favorite feature!!!

SO many times in the past, I'd be concerned about installing new things because they'd break my otherwise pristine developer environment. Yes, rvm/nvm/virtualenv and others help, but they fail to hold a candle to the nix-shell!

Re: NixOS and the Art of OS Configuration (2018)

#118

Earlier quoted context omitted.

> So far I haven't missed any packages that I could not find in nixpkgs, or customize just the way I wanted to. And it's honestly not that hard to package things that aren't yet Nixified. Any C project is easy - I've learned more about cmake from mkDerivation that anywhere else. And overlays make it easy to make tweaks to a build without straight-up forking. Beautiful!

> I've learned more about cmake from mkDerivation that anywhere else. This is something I find really fascinating about Nix (or more precisely nixpkgs) that gets overlooked a lot: it is essentially a giant database that documents how different build tools work, how different projects are built, and so on, in an exhaustive and consistent manner. That can be an extremely valuable resource to have in your back pocket, e…

Could not agree more. I've learned more about build systems and different compilers by reading through Nix code than any other endeavor in the past.

Re: NixOS and the Art of OS Configuration (2018)

#120
post #76

Has anybody made a NixOS template image for QubesOS? Arguably dom0 of QubesOS really ought to be NixOS, too. Maybe in 4.2? (P.S. Loving this BSaG blog!)

IIUC, this would be of interest to you: https://spectrum-os.org/motivation.html

Thank you, I give her money every month through her GitHub donation account.
Post reply on HN