mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
Allows using the `callPackage(s)` pattern on tests. Rather than using `pkgs.callPackage`, we implement our own variant using `lib.callPackageWith`. Our variant (`callTest`) includes additional nixvim-specific stuff commonly used by our tests.
31 lines
816 B
Nix
31 lines
816 B
Nix
{
|
|
nixvim ? "${self}",
|
|
self ? throw "either supply `self` or `nixvim`",
|
|
system,
|
|
mkTestDerivationFromNvim,
|
|
}:
|
|
let
|
|
# This simulates the `default.nix`, but in a pure way so because we are currently in a flake.
|
|
nixvim' =
|
|
(import (
|
|
let
|
|
lock = builtins.fromJSON (builtins.readFile ../flake.lock);
|
|
in
|
|
fetchTarball {
|
|
url =
|
|
lock.nodes.flake-compat.locked.url
|
|
or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
|
sha256 = lock.nodes.flake-compat.locked.narHash;
|
|
}
|
|
) { src = nixvim; }).defaultNix;
|
|
|
|
config = {
|
|
colorschemes.gruvbox.enable = true;
|
|
};
|
|
|
|
nvim = nixvim'.legacyPackages."${system}".makeNixvim config;
|
|
in
|
|
mkTestDerivationFromNvim {
|
|
name = "no-flakes";
|
|
inherit nvim;
|
|
}
|