News for hackers. Stuff that matters.
Re:What's your go to Nix/NixOS pitch? by ronef on Saturday August 12, 2023 @03:34PM (#37103484)
Anything specific you would mention if you had 30 seconds? (meaningful examples we can share on that point)
Re:What's your go to Nix/NixOS pitch? by cfcosta on Saturday August 12, 2023 @03:46PM (#37103585)
Not OP, but here's my take: I have two machines, one with NixOS, one with Mac. I use the same configuration on both. Keeping both machines in sync is a matter of two commands, adding a new machine is also a matter of two commands.

I have tried multiple orchestration options before, but they always fail in some way, ansible for example always work until I have to run something from scratch, then it fails miserably because of something that changed after the 20th time I've ran the script. On Nix, that's not even a consideration.

Re:What's your go to Nix/NixOS pitch? by conception on Saturday August 12, 2023 @03:58PM (#37103701)
What are the two commands for further reading? Not familiar with Nix.
Re:What's your go to Nix/NixOS pitch? by Aerbil313 on Saturday August 12, 2023 @04:03PM (#37103740)
(Not OP) cp to copy the /etc/nixos/configuration.nix file, and nixos-rebuild to build the system defined in the file on the new machine.
Re:What's your go to Nix/NixOS pitch? by viraptor on Saturday August 12, 2023 @04:14PM (#37103836)
Or if you're sharing configuration, it's most likely a "git pull" rather than "cp".
Re:What's your go to Nix/NixOS pitch? by cfcosta on Saturday August 12, 2023 @04:27PM (#37103943)
Yes, to be specific it's a git clone and a command to apply the flake.
Re:What's your go to Nix/NixOS pitch? by yjftsjthsd-h on Saturday August 12, 2023 @06:26PM (#37104773)
If you're using a flake, can't you apply itfrom git in a single command?
Re:What's your go to Nix/NixOS pitch? by cfcosta on Saturday August 12, 2023 @07:12PM (#37105059)
Actually, you can! I always want to clone it either way, so I just do it.
Re:What's your go to Nix/NixOS pitch? by amelius on Saturday August 12, 2023 @04:03PM (#37103737)
How do you configure and install low level hardware drivers? Aren't these different on both systems? And wouldn't proprietary drivers rely on hardcoded versions of libc, for example, causing a dependency hell?
Re:What's your go to Nix/NixOS pitch? by pxc on Saturday August 12, 2023 @04:36PM (#37104029)
* * *
Re:What's your go to Nix/NixOS pitch? by charcircuit on Saturday August 12, 2023 @04:12PM (#37103813)
This is handled by having multiple config files. System specfic stuff goes into a dedicated file which wouldn't be shared.
Re:What's your go to Nix/NixOS pitch? by amelius on Saturday August 12, 2023 @04:13PM (#37103825)
And proprietary drivers?
Re:What's your go to Nix/NixOS pitch? by cfcosta on Saturday August 12, 2023 @04:33PM (#37104001)
I only use one, which is nvidia. It's already a nixos option, so I just set them on my configuration file.

Three options to be exact:

hardware.nvidia.modesetting.enable = true; services.xserver.videoDrivers = [ "nvidia" ]; hardware.opengl = { enable = true; driSupport = true; driSupport32Bit = true; };

First enables nvidia modesetting, second enables the driver, and the third enables opengl, with a special flag to also enable it for 32bit stuff (like old games on steam).

Re:What's your go to Nix/NixOS pitch? by anotherhue on Saturday August 12, 2023 @03:59PM (#37103709)
By shedding the constraints of the FHS [0] it's able to completely rethink how the different components of an operating system interact with each other. It's like going from assembly to a language with functions. Dependencies can be analysed, can be encapsulated. Your OS becomes the output of a build file, not some porcelain edifice of /etc/ files. 'Rollback' is nonsensical, you just run the old build.

I boot to a tmpfs root so all my changes are ephemeral unless I deliberately save them, it's a fresh install on every boot.

0: https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard