News for hackers. Stuff that matters.
Re:Ask HN: Configuration Management for Personal Computer? by jchw on Sunday August 11, 2019 @06:03PM (#20670835)
NixOS can be helpful here, by making all of the non-user-specific stuff completely reproducible; combine that with Git versioning for dotfiles and a NAS for backups and large storage and your setup should be pretty easy to manage.
Re:Ask HN: Configuration Management for Personal Computer? by whateveracct on Sunday August 11, 2019 @07:05PM (#20671115)
NixOS is exactly what the OP is describing. It isn't super user-friendly but once you learn & get things working, the fact that it's code means you can have things working forever.
Re:Ask HN: Configuration Management for Personal Computer? by chrissoundz on Sunday August 11, 2019 @06:33PM (#20670982)
Nixos + storing dotfiles using the simple technique described here (essentially a git repo stored in something other than .git): https://www.atlassian.com/git/tutorials/dotfiles

With the above, the most difficult step in getting a new system installed is now only typing in the WIFI password, drivers and the filesystem partitions...

Re:Ask HN: Configuration Management for Personal Computer? by edude03 on Sunday August 11, 2019 @09:27PM (#20671720)
NixOS + Home Manager + storing your config in dotfiles is exactly what you want :)
Re:Ask HN: Configuration Management for Personal Computer? by mkingston on Monday August 12, 2019 @05:29AM (#20673816)
NixOS is great. I use it as my daily driver. But. In my experience, your distro will never have all the software you would like in its repos. And I've found this is true of NixOS also. So it should be mentioned that some software does not play nicely with it [0][1].

Because some things will be missing from distro repos, packaging is, to me, quite a valuable skill. Compare, for example, the packages for autorandr for Nix and Arch [2][3]. When I started using Arch I found the Arch package fit much better within my understanding of the world. I expect most here would find the same.

Here is what is essentially the manual for Nix packaging [4]. Personally I'd say that if you're unwilling to consume that, eventually you are going to encounter a frustrating problem with Nix that you cannot solve, and potentially regret using it. Though, using a VM or potentially a container might get you around some/many of those issues. I should also mention that Nix Pills may be worth a read before beginning to use NixOS- it's what convinced me to switch, in fact.

[0] https://unix.stackexchange.com/questions/522822/different-me...

[1] https://github.com/NixOS/nixpkgs/issues/36759

[2] https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=autor...

[3] https://github.com/NixOS/nixpkgs/blob/e380ef398761206954e514...

[4] https://nixos.org/nixos/nix-pills/

Re:Ask HN: Configuration Management for Personal Computer? by jchw on Monday August 12, 2019 @10:57AM (#20675968)
I’ve had no issue contributing to fix small holes in NixOS, and Docker covers the rest. So far the only thing that I’ve found genuinely challenging is getting complex binary software running. I have a Nix expression for IDA free but it can only use bundled Qt. VMWare Workstation I outright can’t use, which is a shame since I have a Pro license, but it woke me up to how great KVM is, so there’s that.

I would not recommend NixOS to everyone, but I definitely would recommend it to the type of person who wants to automate their system.

Re:Ask HN: Configuration Management for Personal Computer? by bamboozled on Sunday August 11, 2019 @06:50PM (#20671053)
Same this is what I use, and I've not looked back since. NixOS definitely has a slight learning curve, I find it quite intuitive to use but after time you get the hang of it.
Re:Ask HN: Configuration Management for Personal Computer? by vaibhavsagar on Sunday August 11, 2019 @06:25PM (#20670940)
+1 for NixOS, it changed the way I approach my personal computer.
Re:Ask HN: Configuration Management for Personal Computer? by crispinb on Monday August 12, 2019 @01:30AM (#20672688)
NixOS looks quite fascinating.

I'm on Windows for the time being, but will give NixOS a go some time.

For any other WSL users here, it's worth keeping an eye on this issue: https://github.com/NixOS/nixpkgs/issues/30391 (NixOS being packaged up as a WSL distro).

Re:Ask HN: Configuration Management for Personal Computer? by gitgud on Monday August 12, 2019 @12:44AM (#20672484)
> NixOS can be helpful here, by making all of the non-user-specific stuff completely reproducible

How is this different from say Debian's "apt" package manager?

You can specifically reproduce the system by downloading all versions of the packages you have, right?

Re:Ask HN: Configuration Management for Personal Computer? by jchw on Monday August 12, 2019 @12:57AM (#20672544)
Consider reading the NixOS documentation if you would like to learn more, because it’s worth it imo, but no, Debian is a different case.

NixOS doesn’t just manage packages, it manages the entire system holistically. You effectively have a single configuration file (or multiple) that configure every package, service, mount, ramdisk, driver, etc. If I delete everything but my home folder, my configuration file can be used to completely recreate the root and all of its configurations. Have a KVM GPU passthrough? That can be expressed. Want to override bashrc or zshrc globally? Yep. Want to setup users, LDAP, Samba, FTP? Same configuration. It goes as far as to make most files read only so that you can’t accidentally change things.

But it goes further with build reproducibility. All builds are hashed with their inputs. Every package specifies the sha256 sum of their sources. If your package builds on one machine, it shall build on another.

But it keeps going further. NixOS eschews normal shared library paths. Binaries always refer to Nix store paths in their runpath, making sure it will only ever load the version of the library it was built to load.

And there is still more. NixOS tracks generations. Any time you rebuild the system to change a config or add a new package to the root, you get a new generation that can be rolled back. The default bootloader lets you choose what generation to boot. So if you mess up your configuration, you very rarely need recovery media.

It may not seem very important, but it pretty much changes how you interact with your OS. If you want to restart from scratch, just make sure you have copies of your home folder and configs and start over. This is great for switching to LVM or deciding to use LUKS, where it may not be easy to do without reformatting.

It does take investment, but if you have multiple machines it becomes amortized. I’m running 3 machines with largely identical setups.

Re:Ask HN: Configuration Management for Personal Computer? by mbrock on Monday August 12, 2019 @07:34AM (#20674447)
I share a NixOS config setup with my brother. It’s been evolving since 2015. He recently got a new laptop after using Mac for a year, cloned our repo, and was up and running. It really makes the computer feel like a commodity and the configuration like a sharable durable trackable artifact.
Re:Ask HN: Configuration Management for Personal Computer? by gitgud on Monday August 12, 2019 @02:17AM (#20672892)
Wow, thanks for the detailed response. Yes it sounds like they've taken great care for reproducibility, which I greatly appreciate.

Sounds very similar to Docker's philosophy, where changes to the system produce incremental changes to the system image and all dependencies are strictly controlled.

What else do I need to be convinced to leave my Ubuntu system for NixOS?

Re:Ask HN: Configuration Management for Personal Computer? by vbrandl on Monday August 12, 2019 @04:33AM (#20673589)
You don't have to ditch Ubuntu right away. You can install the nix package manager on any Linux distro (and I think also *BSD and MacOS). That way you can play around with it first. You won't get the full power of NixOS but it's a good way to get started.
Re:Ask HN: Configuration Management for Personal Computer? by funcDropShadow on Monday August 12, 2019 @03:30AM (#20673265)
Docker tries to solve these problems only on the surface. Nothing in a Dockerfile guarantees reproducability. Try docker build of you favorite Dockerfile today and next week. The images probably won't be the same. Whereas NixOS allows you to build the exact same system now and whenever you want. Although, you'd have to pin the nixpkgs you are using.
Re:Ask HN: Configuration Management for Personal Computer? by pknopf on Monday August 12, 2019 @09:07PM (#20681841)
Sure, they won't be the same, but they will be damn close. We aren't looking for the same md5 checksums. That goal isn't worth it.
Re:Ask HN: Configuration Management for Personal Computer? by pknopf on Monday August 12, 2019 @09:08PM (#20681849)
Don't leave Ubuntu. Boot your Ubuntu Docker images bare metal.

https://godarch.com/

https://github.com/pauldotknopf/darch-recipes