vars-check: replace slow python implementation with pure nix

This commit is contained in:
Jörg Thalheim
2025-06-30 00:37:04 +02:00
parent 78379e81e4
commit a780dbe60c
3 changed files with 245 additions and 122 deletions

View File

@@ -30,65 +30,29 @@ in
};
config.checks = lib.optionalAttrs (pkgs.stdenv.isLinux) (
let
# Build all individual vars-check derivations
varsChecks = lib.mapAttrs' (
name: testModule:
lib.nameValuePair "vars-check-${name}" (
let
test = nixosLib.runTest (
{ ... }:
# Add the VM tests as checks (vars-check is part of the test closure)
lib.mapAttrs (
_name: testModule:
nixosLib.runTest (
{ ... }:
{
imports = [
self.modules.nixosTest.clanTest
testModule
];
hostPkgs = pkgs;
defaults = {
imports = [
{
imports = [
self.modules.nixosTest.clanTest
testModule
];
hostPkgs = pkgs;
defaults = {
imports = [
{
_module.args.clan-core = self;
}
];
};
_module.args.clan-core = self;
}
);
in
test.config.result.vars-check
)
) cfg;
in
lib.mkMerge [
# Add the VM tests as checks
(lib.mapAttrs' (
name: testModule:
lib.nameValuePair "service-${name}" (
nixosLib.runTest (
{ ... }:
{
imports = [
self.modules.nixosTest.clanTest
testModule
];
hostPkgs = pkgs;
defaults = {
imports = [
{
_module.args.clan-core = self;
}
];
};
}
)
)
) cfg)
varsChecks
]
];
};
}
)
) cfg
);
}
);