mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-08 19:31:31 +00:00
machine tests take two
This commit is contained in:
parent
6b841d4b97
commit
45c8ffb40e
5 changed files with 206 additions and 0 deletions
42
flake/tests/default.nix
Normal file
42
flake/tests/default.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
inputs,
|
||||
self,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
perSystem = {pkgs, ...}: let
|
||||
inherit (lib.filesystem) packagesFromDirectoryRecursive;
|
||||
inherit (lib.customisation) callPackageWith;
|
||||
inherit (lib.attrsets) recursiveUpdate;
|
||||
|
||||
# Attribute set containing paths to specific profiles. This is meant to be
|
||||
# an easy path to where profiles are defined as the tests directory gets
|
||||
# more complicated, and allow easier renames.
|
||||
profiles = {
|
||||
# Minimal profile is small and lightweight. Plugins that require dependencies
|
||||
# or tests that are resource intensive should not use the minimal profile.
|
||||
minimal = ./profiles/minimal.nix;
|
||||
};
|
||||
|
||||
modules = {
|
||||
nixos = config.flake.nixosModules;
|
||||
home-manager = config.flake.homeManagerModules;
|
||||
};
|
||||
|
||||
# Call tests with preset special arguments.
|
||||
defaultInherits = {inherit inputs profiles modules;};
|
||||
callPackage = callPackageWith (recursiveUpdate pkgs defaultInherits);
|
||||
checkPackages = packagesFromDirectoryRecursive {
|
||||
inherit callPackage;
|
||||
directory = ./checks;
|
||||
};
|
||||
in {
|
||||
# Machine tests that will be ran either manually with 'nix build .#checks.<system>.<check>'
|
||||
# or automatically on 'nix flake check' unless '--no-build-checks' has been passed to it.
|
||||
# We merge 'config.legacyPackages' here to make sure we also build and check plugin packages
|
||||
# that are declared in legacyPackages are built as well, which is usually reserved to Neovim
|
||||
# plugins tracked with npins.
|
||||
checks = checkPackages;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue