nix-community.nixvim/tests/no-flake.nix
traxys dcbe894bea
Fix issue with non flake import (#1102)
* Update flake compat

* tests: Add a test without flakes
2024-02-15 22:51:26 +01:00

32 lines
790 B
Nix

{
system,
nixvim,
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;
}