1
1
mirror of https://github.com/nmattia/niv.git synced 2024-09-18 19:07:19 +03:00

Add subpath handling to FAQ

This commit is contained in:
Nicolas Mattia 2020-07-23 15:55:40 +02:00
parent 0d30bfd7b0
commit c0a61e6283
2 changed files with 26 additions and 0 deletions

View File

@ -417,3 +417,16 @@ netrc-file = /PATH/TO/.netrc
GITHUB_TOKEN=$YOUR_GITHUB_TOKEN niv add ...
```
### How do I import a subpath of a source?
In order to use the directory `dir` of a `my-package`, use the following
pattern:
``` nix
let
sources = import ./nix/sources.nix;
in sources.my-package + "/dir"
```
where `sources.my-package` is the root directory, and `+ "/dir"` appends the
subdirectory.

View File

@ -294,3 +294,16 @@ netrc-file = /PATH/TO/.netrc
GITHUB_TOKEN=$YOUR_GITHUB_TOKEN niv add ...
```
### How do I import a subpath of a source?
In order to use the directory `dir` of a `my-package`, use the following
pattern:
``` nix
let
sources = import ./nix/sources.nix;
in sources.my-package + "/dir"
```
where `sources.my-package` is the root directory, and `+ "/dir"` appends the
subdirectory.