mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
27 lines
639 B
Nix
27 lines
639 B
Nix
{
|
|
makeNixvimWithModule,
|
|
runCommandLocal,
|
|
}:
|
|
let
|
|
firstStage = makeNixvimWithModule {
|
|
module = {
|
|
extraConfigLua = "-- first stage";
|
|
};
|
|
};
|
|
|
|
secondStage = firstStage.extend { extraConfigLua = "-- second stage"; };
|
|
|
|
generated = secondStage.extend { extraConfigLua = "-- third stage"; };
|
|
in
|
|
runCommandLocal "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
|
|
|
|
touch $out
|
|
''
|