1
1
mirror of https://github.com/nmattia/niv.git synced 2024-09-16 01:47:08 +03:00

Add NixOS module example

This commit is contained in:
Nicolas Mattia 2020-07-24 12:24:20 +02:00
parent fcfd1111c6
commit 15c82fd184
2 changed files with 27 additions and 1 deletions

View File

@ -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") ];
}
```

View File

@ -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") ];
}
```