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

nix-env -> nix-shell #242

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,36 @@ camlistore.out 7,938,952 x /nix/store/xn5ivjdyslx
$ nix run github:nix-community/nix-index#nix-locate -- bin/hello
```

### From Nixpkgs

From your locally configured version Nixpkgs:
fricklerhandwerk marked this conversation as resolved.
Show resolved Hide resolved

```
$ nix-shell -p nix-index
[nix-shell]$ nix-index
[nix-shell]$ nix-locate bin/hello
```

From the latest rolling release of Nixpkgs:

```
$ nix-shell -p nix-index -I nixpkgs=channel:nixpkgs-unstable
```

### Latest Git version

To install the latest development version of nix-index, simply clone the repo and run `nix-env -if.`:
To run the latest development version of nix-index:

```
$ git clone https://github.com/nix-community/nix-index
$ cd nix-index
$ nix-env -if.
$ nix-shell https://github.com/nix-community/nix-index/tarball/master
fricklerhandwerk marked this conversation as resolved.
Show resolved Hide resolved
```

### Stable
### Stable releases

For the stable version, you can either [checkout](https://git-scm.com/docs/git-checkout) the latest [tag](https://git-scm.com/docs/git-tag) (see the list [here](https://github.com/nix-community/nix-index/tags)) or use Nixpkgs' repositories' and install it with:
To get a specific stable release, use one of the [release tags](https://github.com/nix-community/nix-index/tags):

```
$ nix-env -iA nixos.nix-index
$ nix-shell https://github.com/nix-community/nix-index/tarball/v0.1.7
fricklerhandwerk marked this conversation as resolved.
Show resolved Hide resolved
```

## Usage
Expand Down
25 changes: 14 additions & 11 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# This file is the compt layer of flakes: https://github.com/edolstra/flake-compat
# See flake.nix for details
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash; }
) {
src = ./.;
}).defaultNix
{ system ? builtins.currentSystem }:
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);

inherit (lock.nodes.flake-compat.locked) owner repo rev narHash;

flake-compat = fetchTarball {
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
sha256 = narHash;
};

flake = import flake-compat { inherit system; src = ./.; };
in
flake.defaultNix
11 changes: 5 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@

inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
flake-compat.url = "github:nix-community/flake-compat";
};

outputs = { self, nixpkgs, flake-compat }:
Expand Down
14 changes: 14 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ system ? builtins.currentSystem }:
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);

inherit (lock.nodes.flake-compat.locked) owner repo rev narHash;

flake-compat = fetchTarball {
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
sha256 = narHash;
};

flake = import flake-compat { inherit system; src = ./.; };
in
flake.shellNix
Loading