Exposes a library helper and a flake-parts module to dynamically inspect NixOS configurations and register their enabled services to Nixpkgs' integration tests for CI/checks.
inputs.nixos-test-harvester = {
url = "https://gist.github.com/Malix-Labs/d58d2af9be08519099b17abb25f4d5be";
type = "git";
inputs.nixpkgs.follows = "nixpkgs";
# inputs.flake-parts.follows = "flake-parts"; # Optional, only if using flake-parts module
};Import the module and enable it. Optionally configure the filters and nesting:
imports = [
inputs.nixos-test-harvester.nixosModules.default
];
services.nixos-test-harvester = {
enable = true;
filter.heavy.enable = false; # Don't filter out heavy system tests (defaults to true)
filter.custom = [ "service-to-ignore" "another-one" ]; # Custom service names to filter out
# filter.hydra = false; # Don't filter out tests already passed by Hydra (defaults to true)
nesting.enable = true; # Group all tests under a single linkFarm check
# nesting.name = "nixos-tests-custom"; # Optional custom top check name
};Import the flake-parts module to automatically populate checks:
imports = [
inputs.nixos-test-harvester.flakeModules.default
];Or pass your hosts configurations and library to harvestAll:
checks = inputs.nixos-test-harvester.lib.harvestAll {
hosts = self.nixosConfigurations;
inherit (inputs.nixpkgs) lib;
};