Added test for template and fixed check export for lib (#361)
This commit is contained in:
parent
ecaf80b7fd
commit
3600698aba
8 changed files with 40 additions and 9 deletions
9
templates/_wrapper/README.md
Normal file
9
templates/_wrapper/README.md
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# templates/_wrapper
|
||||
|
||||
This directory contains wrapper flakes for the nixvim templates.
|
||||
The purpose of the wrappers is to be able to run tests on templates deterministically on the branch or PR that is being worked on.
|
||||
It does this by overwriting the url of nixvim and other dependencies to a path within this repo.
|
||||
|
||||
It is also used in the github workflows, so that we can always check if the template is working or not
|
||||
|
||||
NOTE: It is important that we do not commit the `flake.lock` files here as that could cause problems with the check once any files are updated outside the wrapper. Also we cannot add `flake.lock` to `.gitignore` since nix will sometimes complain.
|
||||
12
templates/_wrapper/simple/flake.nix
Normal file
12
templates/_wrapper/simple/flake.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
inputs = {
|
||||
nixvim.url = "path:../../..";
|
||||
simple = {
|
||||
url = "path:../../simple";
|
||||
inputs.nixvim.follows = "nixvim";
|
||||
inputs.flake-utils.follows = "nixvim/flake-utils";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs: inputs.simple;
|
||||
}
|
||||
|
|
@ -12,10 +12,10 @@
|
|||
flake-utils,
|
||||
...
|
||||
} @ inputs: let
|
||||
nixvimLib = nixvim.lib;
|
||||
config = import ./config; # import the module directly
|
||||
in
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
nixvimLib = nixvim.lib.${system};
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
nixvim' = nixvim.legacyPackages.${system};
|
||||
nvim = nixvim'.makeNixvimWithModule {
|
||||
|
|
@ -24,8 +24,8 @@
|
|||
};
|
||||
in {
|
||||
checks = {
|
||||
# Run `nix check .` to verify that your config is not broken
|
||||
default = nixvim.lib.${system}.check.checkNvim {
|
||||
# Run `nix flake check .` to verify that your config is not broken
|
||||
default = nixvimLib.check.mkTestDerivationFromNvim {
|
||||
inherit nvim;
|
||||
name = "A nixvim configuration";
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue