5 ms·
So does this allow for different boot setups for NixOS? Say “webserver” or “office management” , “media streamer” profiles?
by prox 3y ago
So does this allow for different boot setups for NixOS? Say “webserver” or “office management” , “media streamer” profiles?
- SAI_Peregrinus 3y agoYes. E.g. some guy's config with 6 different machines[1]: multiple desktops, laptops, servers, a Raspberry Pi, and a VPS. That's a rather advanced use of Nix for configuration, but definitely shows what it's capable of. [1] https://github.com/Misterio77/nix-config https://github.com/Misterio77/nix-config
- prox 3y agoWow! Really impressive.
- mindslight 3y agoI wouldn't even say that's so advanced. I've got a similar scope config (not published, sorry). All built from source, with the resulting binaries pushed to less-trusted hosts. My cloud servers, router, wifi APs, Kodi boxes, etc, all running self-hosted self-built software with config kept in git. Previously I ran Debian across my setup (with a homemade configuration templating/distribution tool) but it feels like Nix really bundles up the accidental complexity of installing/deploying most software in a contained way, much more than a traditional distro. I'll be much happier when Nix gains full reproducibility and functionality like Guix's `challenge`. But even now it feels like one of the closest implementations to the Free Software dream.
- hamandcheese 3y agoI'm not exactly sure what you mean. NixOS doesn't have, like, a profile switcher to let you switch between work mode and play mode on the same PC. At least not out of the box. But if you mean distinct computers, then that's just three distinct configs. And it's easy to factor out common bits and use it in all three configs, since you configure things using Nix-the-language. And if you mean all three at the same time on one PC, that's exactly what I do with my home server.
- ElectricalUnion 3y ago> NixOS doesn't have, like, a profile switcher to let you switch between work mode and play mode on the same PC. I thought that `sudo nixos-rebuild switch` was supposed to do exactly that; swap from whatever "state" your PC is on to the result of the nix expresison on "/etc/nixos/configuration.nix"
- hamandcheese 3y agoYes, that is how you update your system. But it would be very unusual to constantly switch between two long-lived configs. I don't see why it wouldn't work, though.
- misterio7 3y agoYeah! There's specializations[1] to make this even simpler. [1] https://nixos.wiki/wiki/Specialisation https://nixos.wiki/wiki/Specialisation