2024-08-28 09:48:10 +01:00
|
|
|
{
|
|
|
|
makeNixvimWithModule,
|
2024-12-31 22:22:44 +01:00
|
|
|
runCommandLocal,
|
2024-08-28 09:48:10 +01:00
|
|
|
}:
|
2023-12-09 15:42:15 +01:00
|
|
|
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-05-05 19:39:35 +02:00
|
|
|
module =
|
2024-01-07 20:49:17 +01:00
|
|
|
{ regularArg, extraModule, ... }:
|
2024-05-05 19:39:35 +02:00
|
|
|
{
|
2024-01-07 20:49:17 +01:00
|
|
|
_module.args = {
|
|
|
|
regularArg = "regularValue";
|
2024-05-05 19:39:35 +02:00
|
|
|
};
|
2024-01-07 20:49:17 +01:00
|
|
|
imports = [
|
|
|
|
defaultModule
|
|
|
|
extraModule
|
2024-05-05 19:39:35 +02:00
|
|
|
];
|
|
|
|
};
|
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
|
2024-12-31 22:22:44 +01:00
|
|
|
runCommandLocal "special-arg-test" { printConfig = "${generated}/bin/nixvim-print-init"; } ''
|
2023-12-09 15:42:15 +01:00
|
|
|
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
|
|
|
|
''
|