mirror of
https://github.com/nmattia/niv.git
synced 2024-11-07 22:36:53 +03:00
Update README
This commit is contained in:
parent
697d66c96a
commit
aa848bf39a
41
README.md
41
README.md
@ -2,7 +2,8 @@
|
||||
|
||||
[![CircleCI](https://circleci.com/gh/nmattia/niv.svg?style=svg)](https://circleci.com/gh/nmattia/niv)
|
||||
|
||||
A tool for dealing with third-party packages in [Nix].
|
||||
A tool for dealing with third-party packages in [Nix]. Read more about it in
|
||||
the [usage](#usage) section.
|
||||
|
||||
## Install
|
||||
|
||||
@ -23,9 +24,20 @@ $ snack run -- <args>
|
||||
|
||||
## Usage
|
||||
|
||||
* [Add](#add)
|
||||
* [Update](#update)
|
||||
* [Drop](#drop)
|
||||
`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.
|
||||
|
||||
```
|
||||
NIV - Version manager for Nix projects
|
||||
@ -114,4 +126,25 @@ Available options:
|
||||
|
||||
```
|
||||
|
||||
### Init
|
||||
|
||||
```
|
||||
Usage: niv init
|
||||
Initialize a Nix project. Existing files won't be modified.
|
||||
|
||||
Available options:
|
||||
-h,--help Show this help text
|
||||
|
||||
```
|
||||
|
||||
### show
|
||||
|
||||
```
|
||||
Usage: niv show
|
||||
|
||||
Available options:
|
||||
-h,--help Show this help text
|
||||
|
||||
```
|
||||
|
||||
[Nix]: https://nixos.org/nix/
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
[![CircleCI](https://circleci.com/gh/nmattia/niv.svg?style=svg)](https://circleci.com/gh/nmattia/niv)
|
||||
|
||||
A tool for dealing with third-party packages in [Nix].
|
||||
A tool for dealing with third-party packages in [Nix]. Read more about it in
|
||||
the [usage](#usage) section.
|
||||
|
||||
## Install
|
||||
|
||||
@ -23,9 +24,20 @@ $ snack run -- <args>
|
||||
|
||||
## Usage
|
||||
|
||||
* [Add](#add)
|
||||
* [Update](#update)
|
||||
* [Drop](#drop)
|
||||
`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.
|
||||
|
||||
```
|
||||
replace_niv_help
|
||||
@ -49,4 +61,16 @@ replace_niv_update_help
|
||||
replace_niv_drop_help
|
||||
```
|
||||
|
||||
### Init
|
||||
|
||||
```
|
||||
replace_niv_init_help
|
||||
```
|
||||
|
||||
### show
|
||||
|
||||
```
|
||||
replace_niv_show_help
|
||||
```
|
||||
|
||||
[Nix]: https://nixos.org/nix/
|
||||
|
@ -12,27 +12,15 @@ rec
|
||||
(runCommand "niv_help" { buildInputs = [ niv ]; }
|
||||
"niv --help > $out"
|
||||
);
|
||||
niv_add_help = builtins.readFile
|
||||
(runCommand "niv_add_help" { buildInputs = [ niv ]; }
|
||||
"niv add --help > $out"
|
||||
);
|
||||
niv_update_help = builtins.readFile
|
||||
(runCommand "niv_update_help" { buildInputs = [ niv ]; }
|
||||
"niv update --help > $out"
|
||||
);
|
||||
niv_drop_help = builtins.readFile
|
||||
(runCommand "niv_drop_help" { buildInputs = [ niv ]; }
|
||||
"niv drop --help > $out"
|
||||
niv_cmd_help = cmd: builtins.readFile
|
||||
(runCommand "niv_${cmd}_help" { buildInputs = [ niv ]; }
|
||||
"niv ${cmd} --help > $out"
|
||||
);
|
||||
cmds = [ "add" "update" "drop" "init" "show" ];
|
||||
};
|
||||
lib.replaceStrings
|
||||
[
|
||||
"replace_niv_help"
|
||||
"replace_niv_add_help"
|
||||
"replace_niv_update_help"
|
||||
"replace_niv_drop_help"
|
||||
]
|
||||
[ niv_help niv_add_help niv_update_help niv_drop_help ]
|
||||
([ "replace_niv_help" ] ++ (map (cmd: "replace_niv_${cmd}_help") cmds))
|
||||
([ niv_help ] ++ (map niv_cmd_help cmds))
|
||||
template
|
||||
);
|
||||
readme-test = runCommand "README-test" {}
|
||||
|
Loading…
Reference in New Issue
Block a user