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

Update FAQ to explain submodules #393

Merged
merged 5 commits into from
Feb 22, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down Expand Up @@ -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 git submodules?
nmattia marked this conversation as resolved.
Show resolved Hide resolved

Yes, however you need to follow some steps.

Add dependecy as git dependecy to your source.json:
nmattia marked this conversation as resolved.
Show resolved Hide resolved
```
niv add git git@github.com:user/repo -n name
```

Add `"submodules": true,` to your dependecy in the source.json:
```
{
"name": {
"branch": "main",
"repo": "git@github.com:user/repo",
"rev": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"submodules": true,
"type": "git"
}
}
```