From there it requires sudo privileges to install the package manager itself.
This sets of a load of alarm bells in terms of security and what it's going to do from there.
As the Nix package manager is packaged for both Debian and Alpine, my two favourite distros next to NixOS, there is no real reason _not_ to use their respective package managers.
When you try to install Nix on Alpine using the aforementioned installation script you also get the warning that it only supports systemd and that you're on your own when it comes to getting it to work on any other init system (Alpine uses OpenRC).
Then there is also the benefit of of being able to remove it with either `apt autoremove --purge nix-setup-systemd` or `apk del nix` instead of having to run said same script a second time.
Yes, I'm aware that you don't _have_ to curl the script directly into `sh` and that you can download it to your local system to see what it's actually doing.
But that doesn't take away from the fact that the official instructions tell you to perform an inherently insecure set of actions by trusting what is effectively a random script on the internet.
_*DISCLAIMER*_: Debian Stable at time of writing has Nix version `2.3.1`, which appears to have some issues that would be fixed by moving to a later version.
Using the official instructions would sidestep this.
As far as I know, you _could in theory_ get away with just adding the `testing` repo and not moving the rest of your system over to `edge`, but I highly doubt that will do any good for the stability of your system.
Moving your system over to the `edge` branch is done by opening `/etc/apk/repositories`, uncommenting the mirrors referring to `edge` and commenting out the lines referring to (at time of writing) version `3.16`.
You can probably also add stable channels, but I haven't tried that, as one of the reasons I want to use the Nix package manager on other distros than NixOS is for it's newer packages.
(I am aware that the stable channel of NixOS is a lot newer than the Debian stable branch, which is precisely why I don't want to to be my base system on machines where I have Debian installed.)