2019-01-31 01:56:35 +03:00
|
|
|
# niv
|
|
|
|
|
2019-02-01 00:05:07 +03:00
|
|
|
[![CircleCI](https://circleci.com/gh/nmattia/niv.svg?style=svg)](https://circleci.com/gh/nmattia/niv)
|
|
|
|
|
2019-02-08 21:29:48 +03:00
|
|
|
A tool for dealing with third-party packages in [Nix]. Read more about it in
|
|
|
|
the [usage](#usage) section.
|
2019-01-31 01:56:35 +03:00
|
|
|
|
2019-02-05 17:18:42 +03:00
|
|
|
## Install
|
|
|
|
|
|
|
|
``` bash
|
|
|
|
$ nix-env -iA niv -f https://github.com/nmattia/niv/tarball/master
|
|
|
|
```
|
|
|
|
|
|
|
|
## Build
|
2019-01-31 01:56:35 +03:00
|
|
|
|
|
|
|
Inside the provided nix shell:
|
|
|
|
|
|
|
|
``` bash
|
|
|
|
$ # GHCi:
|
|
|
|
$ snack ghci
|
|
|
|
$ # run:
|
|
|
|
$ snack run -- <args>
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2019-02-08 21:29:48 +03:00
|
|
|
`niv` simplifies [adding](#add) and [updating](#update) dependencies in Nix
|
|
|
|
projects. It uses a single file, `nix/sources.json`, where it stores the data
|
|
|
|
necessary for fetching and updating the packages.
|
|
|
|
|
|
|
|
* [Add](#add): inserts a package in `nix/sources.json`.
|
|
|
|
* [Update](#update): updates one or all packages in `nix/sources.json`.
|
|
|
|
* [Drop](#drop): deletes a package from `nix/sources.json`.
|
|
|
|
|
|
|
|
`niv` has two more utility functions:
|
|
|
|
|
|
|
|
* [Init](#init): bootstraps a Nix projects, in particular creates a
|
|
|
|
`nix/sources.json` file containing `niv` and `nixpkgs` as well as a
|
|
|
|
`nix/sources.nix` file that returns the sources as a Nix object.
|
|
|
|
* [Show](#show): shows the packages' information.
|
2019-01-31 01:56:35 +03:00
|
|
|
|
|
|
|
```
|
|
|
|
replace_niv_help
|
|
|
|
```
|
|
|
|
|
|
|
|
### Add
|
|
|
|
|
|
|
|
```
|
|
|
|
replace_niv_add_help
|
|
|
|
```
|
|
|
|
|
|
|
|
### Update
|
|
|
|
|
|
|
|
```
|
|
|
|
replace_niv_update_help
|
|
|
|
```
|
|
|
|
|
|
|
|
### Drop
|
|
|
|
|
|
|
|
```
|
|
|
|
replace_niv_drop_help
|
|
|
|
```
|
|
|
|
|
2019-02-08 21:29:48 +03:00
|
|
|
### Init
|
|
|
|
|
|
|
|
```
|
|
|
|
replace_niv_init_help
|
|
|
|
```
|
|
|
|
|
|
|
|
### show
|
|
|
|
|
|
|
|
```
|
|
|
|
replace_niv_show_help
|
|
|
|
```
|
|
|
|
|
2019-01-31 01:56:35 +03:00
|
|
|
[Nix]: https://nixos.org/nix/
|