4 ms·
> 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
by gitgud 7y ago
> 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?
- jchw 7y agoConsider 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.
- gitgud 7y agoWow, 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?
- funcDropShadow 7y agoDocker 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.
- pknopf 7y agoSure, 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.
- vbrandl 7y agoYou 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.
- pknopf 7y agoDon't leave Ubuntu. Boot your Ubuntu Docker images bare metal. https://godarch.com/ https://godarch.com/ https://github.com/pauldotknopf/darch-recipes https://github.com/pauldotknopf/darch-recipes
- mbrock 7y agoI 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.