mirror of
https://github.com/nix-community/flakelight.git
synced 2024-10-05 21:18:00 +03:00
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
|
### functor
|
||||||
|
|
||||||
The `functor` option allows you to make your flake callable.
|
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
|
- homeModules
|
||||||
- homeConfigurations
|
- homeConfigurations
|
||||||
- flakelightModules
|
- flakelightModules
|
||||||
|
- lib
|
||||||
|
|
||||||
The following options can be autoloaded (no module args):
|
The following options can be autoloaded (no module args):
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ in
|
|||||||
homeConfigurations = autoImportArgs' [ "homeConfigurations" "home" ];
|
homeConfigurations = autoImportArgs' [ "homeConfigurations" "home" ];
|
||||||
flakelightModule = autoImport' "flakelightModule";
|
flakelightModule = autoImport' "flakelightModule";
|
||||||
flakelightModules = autoImportArgs' "flakelightModules";
|
flakelightModules = autoImportArgs' "flakelightModules";
|
||||||
|
lib = autoImportArgs' "lib";
|
||||||
functor = autoImport' "functor";
|
functor = autoImport' "functor";
|
||||||
in
|
in
|
||||||
mkMerge [
|
mkMerge [
|
||||||
@ -79,6 +80,7 @@ in
|
|||||||
(mkIf (homeConfigurations != null) { inherit homeConfigurations; })
|
(mkIf (homeConfigurations != null) { inherit homeConfigurations; })
|
||||||
(mkIf (flakelightModule != null) { inherit flakelightModule; })
|
(mkIf (flakelightModule != null) { inherit flakelightModule; })
|
||||||
(mkIf (flakelightModules != null) { inherit flakelightModules; })
|
(mkIf (flakelightModules != null) { inherit flakelightModules; })
|
||||||
|
(mkIf (lib != null) { inherit lib; })
|
||||||
(mkIf (functor != null) { inherit functor; })
|
(mkIf (functor != null) { inherit functor; })
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user