standalone: Fix extraSpecialArgs (#799)

This commit fixes the usage of `extraSpecialArgs` for standalone nixvim
installations and adds a test to ensure this.

Fixes #779
This commit is contained in:
traxys 2023-12-09 15:42:15 +01:00 committed by GitHub
parent dc14748fe7
commit 1f652b60e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 4 deletions

26
tests/extra-args.nix Normal file
View file

@ -0,0 +1,26 @@
{
makeNixvimWithModule,
pkgs,
}: let
generated = makeNixvimWithModule {
module = {importedArgument, ...}: {
extraConfigLua = ''
-- importedArgument=${importedArgument}
'';
};
extraSpecialArgs = {
importedArgument = "foobar";
};
};
in
pkgs.runCommand "special-arg-test" {
printConfig = "${generated}/bin/nixvim-print-init";
} ''
config=$($printConfig)
if ! "$printConfig" | grep -- '-- importedArgument=foobar'; then
echo "Missing importedArgument in config"
exit 1
fi
touch $out
''