mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
29 lines
664 B
Nix
29 lines
664 B
Nix
|
{
|
||
|
makeNixvimWithModule,
|
||
|
pkgs,
|
||
|
}: let
|
||
|
firstStage = makeNixvimWithModule {
|
||
|
module = {
|
||
|
extraConfigLua = "-- first stage";
|
||
|
};
|
||
|
};
|
||
|
|
||
|
secondStage = firstStage.nixvimExtend {extraConfigLua = "-- second stage";};
|
||
|
|
||
|
generated = secondStage.nixvimExtend {extraConfigLua = "-- third stage";};
|
||
|
in
|
||
|
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
|
||
|
|
||
|
touch $out
|
||
|
''
|