wrappers: add env-specific config as part of NixVim module (#1075)

* wrappers: add env-specific config as part of NixVim module

* docs: add section for env-specific module arguments
This commit is contained in:
Gabriel Arazas 2024-02-22 07:24:13 +00:00 committed by GitHub
parent 9cd3721adf
commit d6a66851fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 15 additions and 3 deletions

View file

@ -57,6 +57,9 @@ The imports can be added as a `imports = [ <nixvim_import> ]` in a configuration
You will then be able to enable nixvim through `programs.nixvim.enable = true`, and configure the You will then be able to enable nixvim through `programs.nixvim.enable = true`, and configure the
options as `programs.nixvim.<path>.<to>.<option> = <value>`. options as `programs.nixvim.<path>.<to>.<option> = <value>`.
When you use nixvim as a module, an additional module argument is passed on allowing you to peek through the configuration with `hmConfig`, `nixosConfig`, and `darwinConfig` for home-manager, NixOS, and nix-darwin respectively.
This is useful is you use nixvim both as part of an environment and as standalone.
## 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}`:

View file

@ -18,7 +18,10 @@ in {
default = {}; default = {};
type = types.submoduleWith { type = types.submoduleWith {
shorthandOnlyDefinesConfig = true; shorthandOnlyDefinesConfig = true;
specialArgs.helpers = helpers; specialArgs = {
darwinConfig = config;
inherit helpers;
};
modules = modules =
[ [
{ {

View file

@ -23,7 +23,10 @@ in {
default = {}; default = {};
type = types.submoduleWith { type = types.submoduleWith {
shorthandOnlyDefinesConfig = true; shorthandOnlyDefinesConfig = true;
specialArgs.helpers = helpers; specialArgs = {
hmConfig = config;
inherit helpers;
};
modules = modules =
[ [
{ {

View file

@ -23,7 +23,10 @@ in {
default = {}; default = {};
type = types.submoduleWith { type = types.submoduleWith {
shorthandOnlyDefinesConfig = true; shorthandOnlyDefinesConfig = true;
specialArgs.helpers = helpers; specialArgs = {
nixosConfig = config;
inherit helpers;
};
modules = modules =
[ [
{ {