mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-15 03:34:31 +02:00
tests/nixpkgs: move nixpkgs module test to dedicated drv
This should be separate from `test-sources` because we want to re-use a
common instance of nixpkgs throughout those tests.
Also, moved the existing nixpkgs module test from `test-sources`.
This partially reverts commit c4ad4d0b2e
.
This commit is contained in:
parent
54e6dbd8c8
commit
5b068e7f8f
3 changed files with 46 additions and 22 deletions
|
@ -1,74 +0,0 @@
|
|||
{
|
||||
# TODO: expect not setting `nixpkgs.pkgs` to throw
|
||||
|
||||
overlays =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
test.runNvim = false;
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
foobar = "foobar";
|
||||
})
|
||||
];
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion = pkgs.foobar or null == "foobar";
|
||||
message = ''
|
||||
Expected `pkgs.foobar` to be "foobar"
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Test that overlays from both `nixpkgs.pkgs` _and_ `nixpkgs.overlays` are applied
|
||||
stacked_overlays =
|
||||
{
|
||||
inputs,
|
||||
system,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
test.runNvim = false;
|
||||
|
||||
nixpkgs.pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
(final: prev: {
|
||||
foobar = "foobar";
|
||||
conflict = "a";
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
hello = "world";
|
||||
conflict = "b";
|
||||
})
|
||||
];
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion = pkgs.foobar or null == "foobar";
|
||||
message = ''
|
||||
Expected `pkgs.foobar` to be "foobar"
|
||||
'';
|
||||
}
|
||||
{
|
||||
assertion = pkgs.hello or null == "world";
|
||||
message = ''
|
||||
Expected `pkgs.hello` to be "world"
|
||||
'';
|
||||
}
|
||||
{
|
||||
assertion = pkgs.conflict or null == "b";
|
||||
message = ''
|
||||
Expected `pkgs.conflict` to be "b"
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue