Skip to content
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

Duplication of search results for nix search #3527

Closed
ghost opened this issue Apr 22, 2020 · 2 comments
Closed

Duplication of search results for nix search #3527

ghost opened this issue Apr 22, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 22, 2020

I'm on NixOS unstable, last update before this issue was posted.

[root@dev:/home/doom3]# echo $NIX_PATH
/root/.nix-defexpr/channels:nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels

[root@dev:/home/doom3]# nix-channel --list
home-manager https://github.com/rycee/home-manager/archive/master.tar.gz
nixos https://nixos.org/channels/nixos-unstable

And whenever I do nix search hello I get

[doom3@dev:~]$ nix search hello
warning: using cached results; pass '-u' to update the cache
* nixos.gnome3.iagno (iagno-3.36.0)
  Computer version of the game Reversi, more popularly called Othello

* nixos.hello (hello)
  A program that produces a familiar, friendly greeting

* nixos.hello-unfree (example-unfree-package-1.0)
  An example package with unfree license (for testing)

* nixos.javaPackages.mavenHello_1_0 (maven-hello)
  Maven Hello World

* nixos.javaPackages.mavenHello_1_1 (maven-hello)
  Maven Hello World

* nixpkgs.gnome3.iagno (iagno-3.36.0)
  Computer version of the game Reversi, more popularly called Othello

* nixpkgs.hello (hello)
  A program that produces a familiar, friendly greeting

* nixpkgs.hello-unfree (example-unfree-package-1.0)
  An example package with unfree license (for testing)

* nixpkgs.javaPackages.mavenHello_1_0 (maven-hello)
  Maven Hello World

* nixpkgs.javaPackages.mavenHello_1_1 (maven-hello)
  Maven Hello World

For my user the $NIX_PATH is the same and the nix-channel --list is empty.

What causes the duplication?

@energizah
Copy link

energizah commented Apr 22, 2020

On my system too <nixos> and <nixpkgs> are the same because on NIX_PATH, nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos, and that nixos channel is https://nixos.org/channels/nixos-unstable.

It would be nice to avoid the duplication of search results in that situation.

@edolstra
Copy link
Member

I rewrote nix search a couple of days ago to no longer rely on NIX_PATH. Instead it takes an argument specifying the flake to search, e.g.

$ nix search nixpkgs hello
* legacyPackages.x86_64-linux.hello (hello)
  A program that produces a familiar, friendly greeting

* legacyPackages.x86_64-linux.hello-unfree (example-unfree-package-1.0)
  An example package with unfree license (for testing)

That fixes this issue.

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

No branches or pull requests

2 participants