forked from extern/flakelight
Add docs and autoloads for the lib option
This commit is contained in:
parent
d75f8fea8b
commit
1bc31924ee
20
api_guide.md
20
api_guide.md
@ -684,6 +684,25 @@ These can be paths, which is preferred as it results in better debug output:
|
||||
}
|
||||
```
|
||||
|
||||
### lib
|
||||
|
||||
The `lib` option allows you to configure the flake's `lib` output.
|
||||
|
||||
For example:
|
||||
|
||||
```nix
|
||||
{
|
||||
inputs.flakelight.url = "github:accelbread/flakelight";
|
||||
outputs = { flakelight, ... }:
|
||||
flakelight ./. {
|
||||
lib = {
|
||||
addFive = x: x + 5;
|
||||
addFour = x: x + 4;
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
### functor
|
||||
|
||||
The `functor` option allows you to make your flake callable.
|
||||
@ -759,6 +778,7 @@ The following options can be autoloaded with optional module args:
|
||||
- homeModules
|
||||
- homeConfigurations
|
||||
- flakelightModules
|
||||
- lib
|
||||
|
||||
The following options can be autoloaded (no module args):
|
||||
|
||||
|
@ -43,6 +43,7 @@ in
|
||||
homeConfigurations = autoImportArgs' [ "homeConfigurations" "home" ];
|
||||
flakelightModule = autoImport' "flakelightModule";
|
||||
flakelightModules = autoImportArgs' "flakelightModules";
|
||||
lib = autoImportArgs' "lib";
|
||||
functor = autoImport' "functor";
|
||||
in
|
||||
mkMerge [
|
||||
@ -79,6 +80,7 @@ in
|
||||
(mkIf (homeConfigurations != null) { inherit homeConfigurations; })
|
||||
(mkIf (flakelightModule != null) { inherit flakelightModule; })
|
||||
(mkIf (flakelightModules != null) { inherit flakelightModules; })
|
||||
(mkIf (lib != null) { inherit lib; })
|
||||
(mkIf (functor != null) { inherit functor; })
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user