mirror of
https://github.com/nmattia/niv.git
synced 2024-09-18 19:07:19 +03:00
Add NixOS module example
This commit is contained in:
parent
fcfd1111c6
commit
15c82fd184
15
README.md
15
README.md
@ -428,5 +428,18 @@ let
|
||||
in sources.my-package + "/dir"
|
||||
```
|
||||
|
||||
where `sources.my-package` is the root directory, and `+ "/dir"` appends the
|
||||
in this example, `sources.my-package` becomes `my-package`'s root directory, and `+ "/dir"` appends the
|
||||
subdirectory.
|
||||
|
||||
### How can I import NixOS modules?
|
||||
|
||||
After the package containing the modules has been `niv add`ed, importing the
|
||||
modules is straightforward:
|
||||
|
||||
``` nix
|
||||
let
|
||||
sources = import ./nix/sources.nix;
|
||||
in {
|
||||
imports = [ (sources.package + "/path/to/module") ];
|
||||
}
|
||||
```
|
||||
|
@ -307,3 +307,16 @@ in sources.my-package + "/dir"
|
||||
|
||||
in this example, `sources.my-package` becomes `my-package`'s root directory, and `+ "/dir"` appends the
|
||||
subdirectory.
|
||||
|
||||
### How can I import NixOS modules?
|
||||
|
||||
After the package containing the modules has been `niv add`ed, importing the
|
||||
modules is straightforward:
|
||||
|
||||
``` nix
|
||||
let
|
||||
sources = import ./nix/sources.nix;
|
||||
in {
|
||||
imports = [ (sources.package + "/path/to/module") ];
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user