Giter VIP home page Giter VIP logo

nix-index's Introduction

nix-index Build Status

A files database for nixpkgs

nix-index is a tool to quickly locate the package providing a certain file in nixpkgs.

Demo
$ nix-locate 'bin/hello'
hello.out                                        29,488 x /nix/store/bdjyhh70npndlq3rzmggh4f2dzdsj4xy-hello-2.10/bin/hello
linuxPackages_4_4.dpdk.examples               2,022,224 x /nix/store/jlnk3d38zsk0bp02rp9skpqk4vjfijnn-dpdk-16.07.2-4.4.52-examples/bin/helloworld
linuxPackages.dpdk.examples                   2,022,224 x /nix/store/rzx4k0pb58gd1dr9kzwam3vk9r8bfyv1-dpdk-16.07.2-4.9.13-examples/bin/helloworld
linuxPackages_4_10.dpdk.examples              2,022,224 x /nix/store/wya1b0910qidfc9v3i6r9rnbnc9ykkwq-dpdk-16.07.2-4.10.1-examples/bin/helloworld
linuxPackages_grsec_nixos.dpdk.examples       2,022,224 x /nix/store/2wqv94290pa38aclld7sc548a7hnz35k-dpdk-16.07.2-4.9.13-examples/bin/helloworld
camlistore.out                                7,938,952 x /nix/store/xn5ivjdyslxldhm5cb4x0lfz48zf21rl-camlistore-0.9/bin/hello

Installation

To install this tool, simply clone the repo and run nix-env -if. to install it into your user environment:

$ git clone https://github.com/bennofs/nix-index
$ cd nix-index
$ nix-env -if.

Usage

First, you need to generate an index by running nix-index. Then, you can use nix-locate pattern. For more information, see nix-locate --help and nix-index --help.

Contributing

If you find any missing features that you would like to implement, I'm very happy about any PRs! You can also create an issue first if the feature is more complex so we can discuss possible implementations.

Here is a quick description of all relevant files:

  • bin/{nix-index, nix-locate}.rs: Implementation of the nix-index / nix-locate command line tools
  • src/database.rs: High-level functions for working with the database format
  • src/files.rs: The data types for working with file listings
  • src/frcode.rs: Low-level implementation of an encoder to efficiently store many file paths (see comments in the file for more details). Used by database.rs.
  • src/hydra.rs: Deals with everything that has to do with downloading from the binary cache (fetching file listings and references)
  • src/nixpkgs.rs: Implements the gathering of the packages (store paths and attributes) using nix-env
  • src/package.rs: High-level data types for representing store paths (sometimes also refered to as a package)
  • src/workset.rs: A queue used by nix-index to implement the recursive fetching (fetching references of everything)

nix-index's People

Contributors

bennofs avatar michaelpj avatar

Watchers

Danylo Hlynskyi avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.