feature nix: add option useAttrPath to use packages attribute path - #787
Merged
Samruddhi Khandale (samruddhikhandale) merged 5 commits intoJan 18, 2024
Conversation
Contributor
Author
|
@microsoft-github-policy-service agree |
Member
|
Thank you for the contribution. This sounds like a great addition. |
Contributor
Author
|
Eljo George (@eljog) hello~ just ping to see how was the result, still waiting for one approving review to be merge 😃 |
nohz.afk (nohzafk)
force-pushed
the
nix-env-option-attr-path
branch
from
January 9, 2024 14:38
ba85e37 to
da7abcc
Compare
Samruddhi Khandale (samruddhikhandale)
requested changes
Jan 17, 2024
Samruddhi Khandale (samruddhikhandale)
left a comment
Member
There was a problem hiding this comment.
Thank you for adding this super cool Feature option, appreciate it ✨
Left some minor comments, otherwise looks great!
Contributor
Author
|
Samruddhi Khandale (@samruddhikhandale) all fixed, thanks. |
Contributor
Author
|
sorry, forget to update the opiton name to useAttributePath in test. updated. |
Samruddhi Khandale (samruddhikhandale)
approved these changes
Jan 18, 2024
Samruddhi Khandale (samruddhikhandale)
left a comment
Member
There was a problem hiding this comment.
🚢 Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add an option
useAttrPathto install packages withnix-env -iAName conversion
If package name doesn't start with
nixpkgs.,nixpkgs.will be added as prefix to pacakge name automatically.Compatibility
useAttrPathusefalseas default value, which won't break existing usage and remains compatibility.Precision and Reliability
Using
nix-env -iAensures the installation of the exact package specified by its attribute path. This precision eliminates any ambiguity that might arise fromnix-env --install, which can install unintended packages if multiple matches are found for a given name or description.Consistency with NixOS Package Search
The attribute paths used with
nix-env -iAdirectly correspond to those listed on the NixOS package search site(https://search.nixos.org/packages). This consistency simplifies the process of finding and installing packages as per official documentation and resources.