mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-02 00:54:48 +02:00
standalone: pass extraSpecialArgs
to lib.evalModules directly (#914)
This commit is contained in:
parent
f85f26878f
commit
46ca452d0b
2 changed files with 25 additions and 8 deletions
|
@ -2,14 +2,26 @@
|
||||||
makeNixvimWithModule,
|
makeNixvimWithModule,
|
||||||
pkgs,
|
pkgs,
|
||||||
}: let
|
}: let
|
||||||
|
defaultModule = {regularArg, ...}: {
|
||||||
|
extraConfigLua = ''
|
||||||
|
-- regularArg=${regularArg}
|
||||||
|
'';
|
||||||
|
};
|
||||||
generated = makeNixvimWithModule {
|
generated = makeNixvimWithModule {
|
||||||
module = {importedArgument, ...}: {
|
module = {
|
||||||
extraConfigLua = ''
|
regularArg,
|
||||||
-- importedArgument=${importedArgument}
|
extraModule,
|
||||||
'';
|
...
|
||||||
|
}: {
|
||||||
|
_module.args = {regularArg = "regularValue";};
|
||||||
|
imports = [defaultModule extraModule];
|
||||||
};
|
};
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
importedArgument = "foobar";
|
extraModule = {
|
||||||
|
extraConfigLua = ''
|
||||||
|
-- specialArg=specialValue
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
@ -17,8 +29,12 @@ in
|
||||||
printConfig = "${generated}/bin/nixvim-print-init";
|
printConfig = "${generated}/bin/nixvim-print-init";
|
||||||
} ''
|
} ''
|
||||||
config=$($printConfig)
|
config=$($printConfig)
|
||||||
if ! "$printConfig" | grep -- '-- importedArgument=foobar'; then
|
if ! "$printConfig" | grep -- '-- regularArg=regularValue'; then
|
||||||
echo "Missing importedArgument in config"
|
echo "Missing regularArg in config"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if ! "$printConfig" | grep -- '-- specialArg=specialValue'; then
|
||||||
|
echo "Missing specialArg in config"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,8 @@ default_pkgs: {
|
||||||
};
|
};
|
||||||
|
|
||||||
eval = lib.evalModules {
|
eval = lib.evalModules {
|
||||||
modules = [module wrap {_module.args = extraSpecialArgs;}] ++ shared.topLevelModules;
|
modules = [module wrap] ++ shared.topLevelModules;
|
||||||
|
specialArgs = extraSpecialArgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
handleAssertions = config: let
|
handleAssertions = config: let
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue