checks/eval-module-clan-vars: optimize to use filtered source

- Replace self.filter with lib.fileset for more precise filtering
- Remove unnecessary clan-core dependency from the test
- Test only needs lib and pkgs, not the full flake context
- Prevents unnecessary rebuilds when unrelated files change
This commit is contained in:
Jörg Thalheim
2025-07-07 20:55:04 +02:00
parent 462974b85c
commit 453691d0bf
2 changed files with 11 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
{ lib, pkgs, ... }: { lib, pkgs }:
let let
eval = eval =
module: module:

View File

@@ -12,9 +12,7 @@ in
{ system, pkgs, ... }: { system, pkgs, ... }:
{ {
legacyPackages.evalTests-module-clan-vars = import ./eval-tests { legacyPackages.evalTests-module-clan-vars = import ./eval-tests {
inherit lib; inherit lib pkgs;
clan-core = self;
pkgs = inputs.nixpkgs.legacyPackages.${system};
}; };
checks.eval-module-clan-vars = pkgs.runCommand "tests" { nativeBuildInputs = [ pkgs.nix-unit ]; } '' checks.eval-module-clan-vars = pkgs.runCommand "tests" { nativeBuildInputs = [ pkgs.nix-unit ]; } ''
export HOME="$(realpath .)" export HOME="$(realpath .)"
@@ -24,11 +22,15 @@ in
--show-trace \ --show-trace \
${inputOverrides} \ ${inputOverrides} \
--flake ${ --flake ${
self.filter { lib.fileset.toSource {
include = [ root = ../../..;
"flakeModules" fileset = lib.fileset.unions [
"nixosModules" ../../../flake.nix
"lib" ../../../flake.lock
(lib.fileset.fileFilter (file: file.name == "flake-module.nix") ../../..)
../../../flakeModules/clan.nix
../../../lib
../../../nixosModules/clanCore/vars
]; ];
} }
}#legacyPackages.${system}.evalTests-module-clan-vars }#legacyPackages.${system}.evalTests-module-clan-vars