-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nix-env: Use pname and version attrs in -q #4463
base: master
Are you sure you want to change the base?
Conversation
Verified that this patch prints correct values in Unstable Nix:
This patch:
|
Wanted to mark this as closing https://github.com/NixOS/nixos-homepage/issues/306 but that issue disappeared (still accessible through API). |
I'm hesitant to modify the semantics of |
We still use |
I marked this as stale due to inactivity. → More info |
Still relevant |
In case this PR is not accepted (which seems so?), a replacement is needed here: How to use With What would be the equivalent using Maybe |
Previously[1], we started including `pname` and `version` keys in `nix-env -qa --json` output (and thus in packages.json). But those values were obtained using parseDrvName, which does not work in many cases, for example when a project does not follow Nix’s arbitrary requirement that version names have to start with a digit. The keys are also misleading as many modern Nixpkgs packages pass identically named attributes to mkDerivation but these keys do not use those values. Let’s fix this discrepancy by officially recognizing `pname` and `version` attributes as special and using them in the JSON output. This will be useful for Repology as well. [1]: NixOS@cd933b2
9b0232a
to
60d6edf
Compare
It might be prudent to generate the repology info in a way that is agnostic to |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nixpkgs-cli-working-group/30517/1 |
Previously1, we started including
pname
andversion
keys innix-env -qa --json
output (and thus in packages.json).But those values were obtained using parseDrvName, which does not work in many cases, for example when a project does not follow Nix’s arbitrary requirement that version names have to start with a digit.
The keys are also misleading as many modern Nixpkgs packages pass identically named attributes to mkDerivation but these keys do not use those values.
Let’s fix this discrepancy by officially recognizing
pname
andversion
attributes as special and using them in the JSON output.This will be useful for Repology as well.