forked from nix-community/nixvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextra-args.nix
42 lines (41 loc) · 924 Bytes
/
extra-args.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
makeNixvimWithModule,
pkgs,
}: let
defaultModule = {regularArg, ...}: {
extraConfigLua = ''
-- regularArg=${regularArg}
'';
};
generated = makeNixvimWithModule {
module = {
regularArg,
extraModule,
...
}: {
_module.args = {regularArg = "regularValue";};
imports = [defaultModule extraModule];
};
extraSpecialArgs = {
extraModule = {
extraConfigLua = ''
-- specialArg=specialValue
'';
};
};
};
in
pkgs.runCommand "special-arg-test" {
printConfig = "${generated}/bin/nixvim-print-init";
} ''
config=$($printConfig)
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"
exit 1
fi
touch $out
''