FiloSottile / age

A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.
https://age-encryption.org
BSD 3-Clause "New" or "Revised" License
15.79k stars 477 forks source link

Improve Nix install command #408

Closed MatthewCash closed 2 years ago

MatthewCash commented 2 years ago

The current install command for Nix (nix-env -i age) is inefficient because it evaluates all of nixpkgs before installing, this is slow and unnecessary.

Changing to nix-env -f '<nixpkgs>' -iA age only evaluates the age attribute and is therefore much quicker.

alerque commented 2 years ago

While I don't doubt you are correct here, I'm a little bit concerned that the widespread conventional wisdom and hence easily recognizable starter tip is probably a better thing to present. Everywhere on the web I see nix-env -i $pkgname and hence when I see it anywhere it is just a tipoff that there is a package and I can "do my usual thing". It seems like the faster alternative is something more advanced Nix-ers would know about anyway and would just be confusing to first-timers. Is that a trade-off worth it for a README on an unrelated project?

FiloSottile commented 2 years ago

I agree with Caleb: the age README is not the place to optimize this. If the obvious and simple command is not the best one, that’s a Nix UX issue, not something to fix in every README out there.

MatthewCash commented 2 years ago

I understand, and I agree that it is not intuitive to have two ways to install packages, especially since it is not immediately clear the difference between the two methods when looking at the commands. The real concern I had is that the command will likely continue to get slower as nixpkgs gets bigger, but you are right that this is fundamentally a Nix issue and if they can't even be consistent in their own manual, then it is probably too much to ask everyone else to fix it individually.