mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
standalone: Allow to pass extraSpecialArgs (#665)
This commit is contained in:
parent
2f06f921e0
commit
0c5dcb56d1
4 changed files with 12 additions and 2 deletions
|
@ -202,6 +202,8 @@ It takes a set with the following keys:
|
|||
- `pkgs`: The nixpkgs to use (defaults to the nixpkgs pointed at by the nixvim flake)
|
||||
- `module`: The nix module definition used to extend nixvim.
|
||||
This is useful to pass additional module machinery like `options` or `imports`.
|
||||
- `extraSpecialArgs`: Extra arguments to pass to the modules when using functions.
|
||||
Can be `self` in a flake for example.
|
||||
|
||||
## How does it work?
|
||||
When you build the module (probably using home-manager), it will install all
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
{self, ...}: {
|
||||
# Import all your configuration modules here
|
||||
imports = [
|
||||
./bufferline.nix
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
nixvim,
|
||||
flake-utils,
|
||||
|
@ -21,6 +22,10 @@
|
|||
nvim = nixvim'.makeNixvimWithModule {
|
||||
inherit pkgs;
|
||||
module = config;
|
||||
# You can use `extraSpecialArgs` to pass additional arguments to your module files
|
||||
extraSpecialArgs = {
|
||||
inherit self;
|
||||
};
|
||||
};
|
||||
in {
|
||||
checks = {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
default_pkgs: modules: {
|
||||
pkgs ? default_pkgs,
|
||||
extraSpecialArgs ? {},
|
||||
module,
|
||||
}: let
|
||||
inherit (pkgs) lib;
|
||||
|
@ -8,7 +9,9 @@ default_pkgs: modules: {
|
|||
|
||||
shared = import ./_shared.nix modules {
|
||||
inherit pkgs lib;
|
||||
config = {};
|
||||
config = {
|
||||
_module.args = extraSpecialArgs;
|
||||
};
|
||||
};
|
||||
|
||||
eval = lib.evalModules {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue