2023-12-09 15:42:15 +01:00
|
|
|
{
|
|
|
|
makeNixvimWithModule,
|
|
|
|
pkgs,
|
|
|
|
}: let
|
2024-01-07 20:49:17 +01:00
|
|
|
defaultModule = {regularArg, ...}: {
|
|
|
|
extraConfigLua = ''
|
|
|
|
-- regularArg=${regularArg}
|
|
|
|
'';
|
|
|
|
};
|
2023-12-09 15:42:15 +01:00
|
|
|
generated = makeNixvimWithModule {
|
2024-01-07 20:49:17 +01:00
|
|
|
module = {
|
|
|
|
regularArg,
|
|
|
|
extraModule,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
_module.args = {regularArg = "regularValue";};
|
|
|
|
imports = [defaultModule extraModule];
|
2023-12-09 15:42:15 +01:00
|
|
|
};
|
|
|
|
extraSpecialArgs = {
|
2024-01-07 20:49:17 +01:00
|
|
|
extraModule = {
|
|
|
|
extraConfigLua = ''
|
|
|
|
-- specialArg=specialValue
|
|
|
|
'';
|
|
|
|
};
|
2023-12-09 15:42:15 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
pkgs.runCommand "special-arg-test" {
|
|
|
|
printConfig = "${generated}/bin/nixvim-print-init";
|
|
|
|
} ''
|
|
|
|
config=$($printConfig)
|
2024-01-07 20:49:17 +01:00
|
|
|
if ! "$printConfig" | grep -- '-- regularArg=regularValue'; then
|
|
|
|
echo "Missing regularArg in config"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if ! "$printConfig" | grep -- '-- specialArg=specialValue'; then
|
|
|
|
echo "Missing specialArg in config"
|
2023-12-09 15:42:15 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
touch $out
|
|
|
|
''
|