4 ms·
Most of the above. - Nix is a tool for building and installing software. - Nix is a language for expressing how to build a package. Nix-the-tool reads express
by hamandcheese 3y ago
Most of the above.
- Nix is a tool for building and installing software.
- Nix is a language for expressing how to build a package. Nix-the-tool reads expressions defined in Nix-the-language to know what to do. At the end of the day, this translates into normal commands that run in a sandboxed build environment.
- Nixpkgs is a monolithic repository of 80000+ packages, defined literally as one giant expression in the Nix language (this works fine because Nix is an extremely lazy language). This also includes lots of helpers and abstractions for building packages that can be handy in your own projects. It is possible to use Nix-the-tool without Nixpkgs, but nobody does.
- NixOS is a Linux distribution built on these foundations. Everything under /etc is built from nix expressions. You can not directly edit these. Mostly NixOS is about building systemd unit files from Nix expressions - viewed through that lens it's not really all that exotic of an OS. NixOS has modules that make it very easy to configure and run lots of software.
- deleted 3y ago[deleted]
- prox 3y agoSo 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