<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>README.md - fork/nix-index @ v0.1.2</title>
<meta name="description" content="README.md in fork/nix-index at v0.1.2.">
<meta property="og:title" content="README.md - fork/nix-index @ v0.1.2">
<meta property="og:description" content="README.md in fork/nix-index at v0.1.2.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="git.julia.blue">
<link rel="stylesheet" href="/css/style.css?v=62">
<script type="module" src="/js/main.js?v=62"></script>
</head>
<body>
<main data-ref="v0.1.2" data-tip="27f4c2b905a736e558c79b06d57cb409a36286a2">
<noscript>
  <div class="callout">
    <p>
      hey! this is a static git repo viewer. commit diffs, file history,
      older commits and other revisions won't load without javascript.
    </p>
    <p>
      you are still able to view source files on branch/tag tips,
      but the experience is degraded.
    </p>
  </div>
</noscript>
<header class="repo"><div>
<h1>fork/nix-index</h1>
</div>
<pre class="clone">git clone https://git.julia.blue/fork/nix-index</pre>
</header>
<p class="snapshot-commit"><span class="commit-author">Benno Fünfstück</span><span class="commit-message" data-commit="d6ac89324dbaa711df845212fd274e387f0a4882">docs(README): remove outdated notes</span><span class="snapshot-sha sha" data-commit="d6ac89324dbaa711df845212fd274e387f0a4882">d6ac893</span><time datetime="2017-08-01T16:03:29+02:00" title="2017-08-01 16:03:29 +0200">2017-08-01</time></p>
<header class="topbar"><details class="switcher"><summary>v0.1.2</summary><div class="menu"><strong>branches</strong><a href="/fork/nix-index/ref/master/">master</a><strong>tags</strong><a href="/fork/nix-index/ref/v0.1.0/">v0.1.0</a><a href="/fork/nix-index/ref/v0.1.1/">v0.1.1</a><a class="current" href="/fork/nix-index/ref/v0.1.2/">v0.1.2</a><a href="/fork/nix-index/ref/v0.1.3/">v0.1.3</a><a href="/fork/nix-index/ref/v0.1.4/">v0.1.4</a><a href="/fork/nix-index/ref/v0.1.5/">v0.1.5</a><a href="/fork/nix-index/ref/v0.1.6/">v0.1.6</a><a href="/fork/nix-index/ref/v0.1.7/">v0.1.7</a><a class="all" href="/fork/nix-index/refs">all refs →</a></div></details><nav class="crumbs"><a href="/fork/nix-index/">nix-index</a> / <span class="cur">README.md</span></nav>
<span class="view-stats"><span>2.7 KiB</span><span>40 lines</span></span><span class="actions"><a class="raw" href="/fork/nix-index/raw/cb2f9fa28038ab452d40438d318d21b1edabb5c9/README.md">raw</a></span></header>
<div class="markdown-view"><input type="radio" name="markdown-view" id="markdown-rendered" checked><label for="markdown-rendered">rendered</label><input type="radio" name="markdown-view" id="markdown-code"><label for="markdown-code">code</label><section class="readme rendered"><h1>nix-index <a href="https://travis-ci.org/bennofs/nix-index"><img src="https://travis-ci.org/bennofs/nix-index.svg?branch=master" alt="Build Status" /></a></h1>
<h2>A files database for nixpkgs</h2>
<p><strong>nix-index</strong> is a tool to quickly locate the package providing a certain file in <a href="https://github.com/NixOS/nixpkgs"><code>nixpkgs</code></a>.</p>
<h6>Demo</h6>
<pre>$ 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
</pre>
<h2>Installation</h2>
<p>To install this tool, simply clone the repo and run <code>nix-env -if.</code> to install it into your user environment:</p>
<pre>$ git clone https://github.com/bennofs/nix-index
$ cd nix-index
$ nix-env -if.
</pre>
<h2>Usage</h2>
<p>First, you need to generate an index by running <code>nix-index</code>. Then, you can use <code>nix-locate pattern</code>. For more information, see <code>nix-locate --help</code> and <code>nix-index --help</code>.</p>
<h2>Contributing</h2>
<p>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.</p>
<p>Here is a quick description of all relevant files:</p>
<ul>
<li><code>bin/{nix-index, nix-locate}.rs</code>: Implementation of the nix-index / nix-locate command line tools</li>
<li><code>src/database.rs</code>: High-level functions for working with the database format</li>
<li><code>src/files.rs</code>: The data types for working with file listings</li>
<li><code>src/frcode.rs</code>: Low-level implementation of an encoder to efficiently store many file paths (see comments in the file for more details). Used by <code>database.rs</code>.</li>
<li><code>src/hydra.rs</code>: Deals with everything that has to do with downloading from the binary cache (fetching file listings and references)</li>
<li><code>src/nixpkgs.rs</code>: Implements the gathering of the packages (store paths and attributes) using <code>nix-env</code></li>
<li><code>src/package.rs</code>: High-level data types for representing store paths (sometimes also refered to as a package)</li>
<li><code>src/workset.rs</code>: A queue used by <code>nix-index</code> to implement the recursive fetching (fetching references of everything)</li>
</ul>
</section><div class="code-panel"><pre class="code src language-markdown"><span class="code-line"><a class="ln" id="L1" href="#L1">1</a><span class="code-text"><a-p>#</a-p> <a-tt>nix-index [![Build Status](https://travis-ci.org/bennofs/nix-index.svg?branch=master)](https://travis-ci.org/bennofs/nix-index)</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text"><a-p>##</a-p> <a-tt>A files database for nixpkgs</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text">**nix-index** is a tool to quickly locate the package providing a certain file in [`nixpkgs`](https://github.com/NixOS/nixpkgs).</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text"><a-p>######</a-p> <a-tt>Demo</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text"><a-p>$ nix-locate &#39;bin/hello&#39;</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text"><a-p>hello.out                                        29,488 x /nix/store/bdjyhh70npndlq3rzmggh4f2dzdsj4xy-hello-2.10/bin/hello</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text"><a-p>linuxPackages_4_4.dpdk.examples               2,022,224 x /nix/store/jlnk3d38zsk0bp02rp9skpqk4vjfijnn-dpdk-16.07.2-4.4.52-examples/bin/helloworld</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text"><a-p>linuxPackages.dpdk.examples                   2,022,224 x /nix/store/rzx4k0pb58gd1dr9kzwam3vk9r8bfyv1-dpdk-16.07.2-4.9.13-examples/bin/helloworld</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L12" href="#L12">12</a><span class="code-text"><a-p>linuxPackages_4_10.dpdk.examples              2,022,224 x /nix/store/wya1b0910qidfc9v3i6r9rnbnc9ykkwq-dpdk-16.07.2-4.10.1-examples/bin/helloworld</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text"><a-p>linuxPackages_grsec_nixos.dpdk.examples       2,022,224 x /nix/store/2wqv94290pa38aclld7sc548a7hnz35k-dpdk-16.07.2-4.9.13-examples/bin/helloworld</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L14" href="#L14">14</a><span class="code-text"><a-p>camlistore.out                                7,938,952 x /nix/store/xn5ivjdyslxldhm5cb4x0lfz48zf21rl-camlistore-0.9/bin/hello</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text"><a-p>## </a-p><a-tt>Installation</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L17" href="#L17">17</a><span class="code-text"><a-p>To install this tool, simply clone the repo and run `nix-env -if.` to install it into your user environment:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L18" href="#L18">18</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L19" href="#L19">19</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L20" href="#L20">20</a><span class="code-text"><a-p>$ git clone https://github.com/bennofs/nix-index</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L21" href="#L21">21</a><span class="code-text"><a-p>$ cd nix-index</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L22" href="#L22">22</a><span class="code-text"><a-p>$ nix-env -if.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L23" href="#L23">23</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L24" href="#L24">24</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L25" href="#L25">25</a><span class="code-text"><a-p>## </a-p><a-tt>Usage</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L26" href="#L26">26</a><span class="code-text"><a-p>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`.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L27" href="#L27">27</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L28" href="#L28">28</a><span class="code-text"><a-p>## </a-p><a-tt>Contributing</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L29" href="#L29">29</a><span class="code-text"><a-p>If you find any missing features that you would like to implement, I&#39;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.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L30" href="#L30">30</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L31" href="#L31">31</a><span class="code-text"><a-p>Here is a quick description of all relevant files:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L32" href="#L32">32</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L33" href="#L33">33</a><span class="code-text"><a-p>* `bin/{nix-index, nix-locate}.rs`: Implementation of the nix-index / nix-locate command line tools</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L34" href="#L34">34</a><span class="code-text"><a-p>* `src/database.rs`: High-level functions for working with the database format</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L35" href="#L35">35</a><span class="code-text"><a-p>* `src/files.rs`: The data types for working with file listings</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L36" href="#L36">36</a><span class="code-text"><a-p>* `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`.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L37" href="#L37">37</a><span class="code-text"><a-p>* `src/hydra.rs`: Deals with everything that has to do with downloading from the binary cache (fetching file listings and references)</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L38" href="#L38">38</a><span class="code-text"><a-p>* `src/nixpkgs.rs`: Implements the gathering of the packages (store paths and attributes) using `nix-env`</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L39" href="#L39">39</a><span class="code-text"><a-p>* `src/package.rs`: High-level data types for representing store paths (sometimes also refered to as a package)</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L40" href="#L40">40</a><span class="code-text"><a-p>* </a-p>`src/workset.rs`: A queue used by `nix-index` to implement the recursive fetching (fetching references of everything)</span></span></pre></div></div>
</main>
</body>
</html>
