Stop using nix-env -iA
and add better instructions for Nix users
#538
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is an alternative to #506.
The original explanation for this PR's change is at #506 (comment) and is copied below.
Nix is a complex beast, with a package management system that looks alien compared to other package managers. A comment on a Github issue is a poor place to explain all that is Nix, so I'll try to provide a short summary of Nix here, and just the parts that are immediately relevant to this issue.
One of the primary points of Nix is declarative package management and configuration. Whereas with other package managers the way to install something would be a shell command, e.g.
sudo apt install firefox
andsudo pacman -S firefox
, the best way to install a package in Nix is editing configuration files. This is conceptually similar to thego.mod
for Go programs, but in the case of Nix, these configuration files defines a configuration of a system, including what programs are installed.However, Nix also provides several other ways to "install" a package. This is where
nix-env -iA zk
andnix profile install nixpkgs#zk
comes from. These two commands install the package imperatively, and I would argue both of these commands are anti-patterns, because Nix is designed for declarative package management.Nix (and NixOS) configurations can get highly customized. Installation instructions necessarily have to assume the user has some basic Nix knowledge. I recommend these lines in the section for Nix in the readme: