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

[wip] programs/nix-index.nix: init module #40679

Closed
wants to merge 1 commit into from

Conversation

matthewbauer
Copy link
Member

Add the nix-index module that will do two things:

  • generate an index of all of the files in the binary cache of your channel
  • add a command-not-found script for bash & zsh

Note that this will run nix-index on every nixos-rebuild. For it to work correctly you need plenty of memory & time.

Add the nix-index module that will do two things:

- generate an index of all of the files in the binary cache of your channel
- add a command-not-found script for bash & zsh
mkdir -p $out/bin
makeWrapper ${pkgs.nix-index}/bin/nix-locate $out/bin/nix-locate \
--add-flags "-d ${cache}"
'';
Copy link
Member

@teto teto May 17, 2018

Choose a reason for hiding this comment

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

is that indentation ok with nixpkgs style ? I tend to align 2 spaces right of the upper starting '' so I wonder

Copy link
Member Author

Choose a reason for hiding this comment

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

Lol probably not

@jtojnar
Copy link
Contributor

jtojnar commented May 17, 2018

Could fish support be added as well? How does the regular command-not-found work with fish?

@infinisil
Copy link
Member

I think it would make more sense to create a package from this, so you can do (import <nixpkgs> {}).nix-locate-cached. Completion scripts can be installed in the shells respective path in $out. This would also allow non-NixOS users to use this.

Have you done some more work on this? I might try to help with this when I have time.

@matthewbauer
Copy link
Member Author

I think it would make more sense to create a package from this, so you can do (import {}).nix-locate-cached. Completion scripts can be installed in the shells respective path in $out. This would also allow non-NixOS users to use this.

I'm not sure if that would work easily. This cannot be built in Hydra because it requires network access. A module makes the most sense to me until we can convince everyone that this should be shipped automatically in the channels in place of programs.sqlite. You only want to run nix-index when pkgs.path is changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants