-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update FAQ to explain submodules (#393)
* Update FAQ to explain submodules * Update README.md * Update README.md * Update README template --------- Co-authored-by: Nicolas Mattia <[email protected]>
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -399,6 +399,7 @@ Available options: | |
* [How do I import a subpath of a source?](#how-do-i-import-a-subpath-of-a-source) | ||
* [How do I import NixOS modules](#how-do-i-import-nixos-modules) | ||
* [Can I use local packages?](#can-i-use-local-packages) | ||
* [Can I use git submodules?](#can-i-use-git-submodules) | ||
|
||
### Can I use private GitHub repositories? | ||
|
||
|
@@ -542,3 +543,25 @@ have a source named `<name>` then `niv` will use the value of | |
characters in the source name are escaped to the character `_`; i.e. to | ||
override the package `my package-foo` you need to set the environment variable | ||
`NIV_OVERRIDE_my_package_foo`. | ||
|
||
### Can I use a git dependency with submodules? | ||
|
||
Yes, however you need to follow some steps. | ||
|
||
Add your dependency as git dependency to your `sources.json`: | ||
``` | ||
niv add git [email protected]:user/repo -n name | ||
``` | ||
|
||
Add `"submodules": true,` to your dependecy in the source.json: | ||
``` | ||
{ | ||
"name": { | ||
"branch": "main", | ||
"repo": "[email protected]:user/repo", | ||
"rev": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", | ||
"submodules": true, | ||
"type": "git" | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -261,6 +261,7 @@ replace_niv_show_help | |
* [How do I import a subpath of a source?](#how-do-i-import-a-subpath-of-a-source) | ||
* [How do I import NixOS modules](#how-do-i-import-nixos-modules) | ||
* [Can I use local packages?](#can-i-use-local-packages) | ||
* [Can I use git submodules?](#can-i-use-git-submodules) | ||
|
||
### Can I use private GitHub repositories? | ||
|
||
|
@@ -404,3 +405,25 @@ have a source named `<name>` then `niv` will use the value of | |
characters in the source name are escaped to the character `_`; i.e. to | ||
override the package `my package-foo` you need to set the environment variable | ||
`NIV_OVERRIDE_my_package_foo`. | ||
|
||
### Can I use a git dependency with submodules? | ||
|
||
Yes, however you need to follow some steps. | ||
|
||
Add your dependency as git dependency to your `sources.json`: | ||
``` | ||
niv add git [email protected]:user/repo -n name | ||
``` | ||
|
||
Add `"submodules": true,` to your dependecy in the source.json: | ||
``` | ||
{ | ||
"name": { | ||
"branch": "main", | ||
"repo": "[email protected]:user/repo", | ||
"rev": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", | ||
"submodules": true, | ||
"type": "git" | ||
} | ||
} | ||
``` |