Hacker News new | ask | show | jobs
by nincompoo 1989 days ago
I use Void now and like not having systemd. Can I install Nix on my Void? Do I then just stop using the native package manager?

Or would it be better to install NixOS? Could I then choose not to use systemd? Would that be hard?

Is the idea that you can define your system in a file and reproduce it more or less automatically?

How does this compare to Guix?

3 comments

> Can I install Nix on my Void?

Yes. (And you won't need to use systemd with just Nix and Nixpkgs)

> Do I then just stop using the native package manager?

No

> Is the idea that you can define your system in a file and reproduce it more or less automatically?

Yes

> How does this compare to Guix?

Very similar. Guix is a fork -> rewrite, with more Scheme and more FSF policy. But core concepts have not diverged.

NixOS uses systemd pretty heavily under the hood. You configure systemd services in the Nix language as part of your system config. It's quite nice.
Yeah, configuring systemd with Nix changed it from annoyance to a pleasure for me. Instead of fiddling with a bunch of random .service files, you can just do everything in a nix config and have them generated for you. Complex systems involving a bunch of units (services, timers, paths, whatever) can all be in one single place--alongside the service config. You can easily share defaults between units.

It's so much nicer than doing it ad-hoc.

You should probably be able to run Nix on Void. It might get awkward running two parallel package managers, but I've heard good things.

The idea of Nix is that you can specify a package's dependencies very explicitly, and have it build in a hermetic, and reproducible, environment. It can handle all sorts of dependencies, be they same-language libraries, binaries, or native system libraries. You can think of it sort of like firing up a docker container in which to run your build--if it works once, it'll always work, and if it works here it should work everywhere.

NixOS adds to that by essentially making the running system one of the packages managed by Nix. You specify what packages should be installed, how those packages should be configured, what services should be run, users that should exist, etc. When you build, the operating system you're running on is replaced with the new one. If anything breaks, you can trivially roll back. If you build the same config on a different host, you'll end up with the same system (albeit with slightly different package versions).

Guix is basically a fork of Nix (or started that way); it's got a very similar approach to Nix (and GuixSD to NixOS). It uses Gnu Shepherd instead of systemd, and uses Scheme for system config instead of a custom language.