Skip to content

feature nix: add option useAttrPath to use packages attribute path - #787

Merged
Samruddhi Khandale (samruddhikhandale) merged 5 commits into
devcontainers:mainfrom
nohzafk:nix-env-option-attr-path
Jan 18, 2024
Merged

feature nix: add option useAttrPath to use packages attribute path#787
Samruddhi Khandale (samruddhikhandale) merged 5 commits into
devcontainers:mainfrom
nohzafk:nix-env-option-attr-path

Conversation

@nohzafk

Copy link
Copy Markdown
Contributor

Add an option useAttrPath to install packages with nix-env -iA

Name conversion

If package name doesn't start with nixpkgs., nixpkgs. will be added as prefix to pacakge name automatically.

Compatibility

useAttrPath use false as default value, which won't break existing usage and remains compatibility.

Precision and Reliability

Using nix-env -iA ensures the installation of the exact package specified by its attribute path. This precision eliminates any ambiguity that might arise from nix-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 -iA directly 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.

@nohzafk
nohz.afk (nohzafk) requested a review from a team as a code owner January 1, 2024 13:49
@nohzafk

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@eljog

Copy link
Copy Markdown
Member

Thank you for the contribution. This sounds like a great addition.
I have approved for the workflow runs.

@nohzafk

nohz.afk (nohzafk) commented Jan 9, 2024

Copy link
Copy Markdown
Contributor Author

Eljo George (@eljog) hello~ just ping to see how was the result, still waiting for one approving review to be merge 😃
i just rebase it on the latest main brach, just your approval to run the workflow again~

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding this super cool Feature option, appreciate it ✨

Left some minor comments, otherwise looks great!

Comment thread src/nix/devcontainer-feature.json
Comment thread src/nix/devcontainer-feature.json Outdated
Comment thread src/nix/install.sh Outdated
@nohzafk

Copy link
Copy Markdown
Contributor Author

Samruddhi Khandale (@samruddhikhandale) all fixed, thanks.

@eljog Eljo George (eljog) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nohzafk

Copy link
Copy Markdown
Contributor Author

sorry, forget to update the opiton name to useAttributePath in test. updated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 Thanks!

@samruddhikhandale
Samruddhi Khandale (samruddhikhandale) merged commit 2b2a5f6 into devcontainers:main Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants