WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Allow nix-env --query to output aliases #14761

@dyegoaurelio

Description

@dyegoaurelio

Is your feature request related to a problem?

The nix-env -qa command is a pretty helpful tool to find out information about package sets.

However, sometimes it's relevant to resolve all aliases of a package, not just he one that gets sorted with higher precedence.

Since, this is how nixos-search resolves it's packages,

https://github.com/NixOS/nixos-search/blob/d99e8c26f72f8b7b43148c92846bb2d463db3ff5/flake-info/src/commands/nixpkgs_info.rs#L12-L22

This would fix NixOS/nixos-search#975

Proposed solution

The dedupe logic happens here. We just need a cli option to tweak this behavior.

nix/src/libexpr/get-drvs.cc

Lines 335 to 338 in 7448aed

/* Remove spurious duplicates (e.g., a set like `rec { x =
derivation {...}; y = x;}'. */
if (!done.insert(v.attrs()).second)
return false;

Additional context

Checklist


Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature request or proposal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions