mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +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)
|
- `pkgs`: The nixpkgs to use (defaults to the nixpkgs pointed at by the nixvim flake)
|
||||||
- `module`: The nix module definition used to extend nixvim.
|
- `module`: The nix module definition used to extend nixvim.
|
||||||
This is useful to pass additional module machinery like `options` or `imports`.
|
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?
|
## How does it work?
|
||||||
When you build the module (probably using home-manager), it will install all
|
When you build the module (probably using home-manager), it will install all
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{self, ...}: {
|
||||||
# Import all your configuration modules here
|
# Import all your configuration modules here
|
||||||
imports = [
|
imports = [
|
||||||
./bufferline.nix
|
./bufferline.nix
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
nixvim,
|
nixvim,
|
||||||
flake-utils,
|
flake-utils,
|
||||||
|
@ -21,6 +22,10 @@
|
||||||
nvim = nixvim'.makeNixvimWithModule {
|
nvim = nixvim'.makeNixvimWithModule {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
module = config;
|
module = config;
|
||||||
|
# You can use `extraSpecialArgs` to pass additional arguments to your module files
|
||||||
|
extraSpecialArgs = {
|
||||||
|
inherit self;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
checks = {
|
checks = {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
default_pkgs: modules: {
|
default_pkgs: modules: {
|
||||||
pkgs ? default_pkgs,
|
pkgs ? default_pkgs,
|
||||||
|
extraSpecialArgs ? {},
|
||||||
module,
|
module,
|
||||||
}: let
|
}: let
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
|
@ -8,7 +9,9 @@ default_pkgs: modules: {
|
||||||
|
|
||||||
shared = import ./_shared.nix modules {
|
shared = import ./_shared.nix modules {
|
||||||
inherit pkgs lib;
|
inherit pkgs lib;
|
||||||
config = {};
|
config = {
|
||||||
|
_module.args = extraSpecialArgs;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
eval = lib.evalModules {
|
eval = lib.evalModules {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue