mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
standalone: Allow to extend a standalone derivation with a new module (#1142)
This adds the `nixvimExtend` attribute to the generated standalone derivation, this attribute takes a module as an argument and returns a new standalone derivation with the initial module & the extended module merged together.
This commit is contained in:
parent
66c019d638
commit
9cd3721adf
6 changed files with 91 additions and 24 deletions
28
tests/extend.nix
Normal file
28
tests/extend.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
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
|
||||
''
|
Loading…
Add table
Add a link
Reference in a new issue