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
|
|
|
}:
|
2024-02-22 08:22:21 +01:00
|
|
|
let
|
|
|
|
firstStage = makeNixvimWithModule {
|
|
|
|
module = {
|
|
|
|
extraConfigLua = "-- first stage";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-07-01 14:20:12 +01:00
|
|
|
secondStage = firstStage.extend { extraConfigLua = "-- second stage"; };
|
2024-02-22 08:22:21 +01:00
|
|
|
|
2024-07-01 14:20:12 +01:00
|
|
|
generated = secondStage.extend { extraConfigLua = "-- third stage"; };
|
2024-02-22 08:22:21 +01:00
|
|
|
in
|
2024-12-31 22:22:44 +01:00
|
|
|
runCommandLocal "extend-test" { printConfig = "${generated}/bin/nixvim-print-init"; } ''
|
2024-02-22 08:22:21 +01:00
|
|
|
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
|
|
|
|
|
|
|
|
touch $out
|
|
|
|
''
|