nix-community.nixvim/tests/extend.nix

25 lines
635 B
Nix
Raw Normal View History

2024-05-05 19:39:35 +02:00
{ makeNixvimWithModule, pkgs }:
let
firstStage = makeNixvimWithModule {
module = {
extraConfigLua = "-- first stage";
};
};
2024-05-05 19:39:35 +02:00
secondStage = firstStage.nixvimExtend { extraConfigLua = "-- second stage"; };
2024-05-05 19:39:35 +02:00
generated = secondStage.nixvimExtend { extraConfigLua = "-- third stage"; };
in
2024-05-05 19:39:35 +02:00
pkgs.runCommand "extend-test" { printConfig = "${generated}/bin/nixvim-print-init"; } ''
config=$($printConfig)
for stage in "first" "second" "third"; do
if ! "$printConfig" | grep -q -- "-- $stage stage"; then
echo "Missing $stage stage in config"
echo "$config"
exit 1
fi
done
2024-05-05 19:39:35 +02:00
touch $out
''