mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
flake/legacyPackages: simplify makeNixvim
, making it more powerful
Rather than nesting it as `config`, pass `makeNixvim`'s argument through directly as a module. This not only simplifies the implementation, but allows users to use `makeNixvim` for any scenario where `makeNixvimWithModule` would normally be required.
This commit is contained in:
parent
10f64e6c96
commit
c062b976ef
2 changed files with 4 additions and 9 deletions
|
@ -75,9 +75,10 @@ If using the home-manager module, see [Home Manager Usage](./modules/hm.md) for
|
||||||
### Standalone usage
|
### Standalone usage
|
||||||
|
|
||||||
When using nixvim as a standalone derivation you can use the following functions, located in `<nixvim>.legacyPackages.${system}`:
|
When using nixvim as a standalone derivation you can use the following functions, located in `<nixvim>.legacyPackages.${system}`:
|
||||||
- `makeNixvim`: This function takes an attribute set of options values as arguments
|
- `makeNixvim`: A simplified version of `makeNixvimWithModule` for when you only need to specify `module` and the other options can be left as the defaults.
|
||||||
|
This function's only argument is a nixvim module, e.g. `{ extraConfigLua = "print('hi')"; }`
|
||||||
- `makeNixvimWithModule`: This function takes an attribute set of the form: `{pkgs, extraSpecialArgs, module}`.
|
- `makeNixvimWithModule`: This function takes an attribute set of the form: `{pkgs, extraSpecialArgs, module}`.
|
||||||
The only required argument is `module`, being a NixOS module. This gives access to the `imports`, `options`, `config` variables, and using functions like `{config, ...}: { ... }`.
|
The only required argument is `module`, being a nixvim module. This gives access to the `imports`, `options`, `config` variables, and using functions like `{config, ...}: { ... }`.
|
||||||
|
|
||||||
There are also some helper functions in `<nixvim>.lib.${system}` like:
|
There are also some helper functions in `<nixvim>.lib.${system}` like:
|
||||||
- `check.mkTestDerivationFromNixvimModule`, taking the same arguments as `makeNixvimWithModule` and generates a check derivation.
|
- `check.mkTestDerivationFromNixvimModule`, taking the same arguments as `makeNixvimWithModule` and generates a check derivation.
|
||||||
|
|
|
@ -9,13 +9,7 @@
|
||||||
{
|
{
|
||||||
legacyPackages = rec {
|
legacyPackages = rec {
|
||||||
inherit makeNixvimWithModule;
|
inherit makeNixvimWithModule;
|
||||||
makeNixvim =
|
makeNixvim = module: makeNixvimWithModule { inherit module; };
|
||||||
configuration:
|
|
||||||
makeNixvimWithModule {
|
|
||||||
module = {
|
|
||||||
config = configuration;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue