Wrap NixOS build checks

NixOS build checks significantly slowed down `nix flake show` as it
prints out the derivation names, which for NixOS derivations requires a
large amount of evaluation. By wrapping the derivations, we now give
them trivial names. The NixOS configurations are still built when
running checks as they are a dependency of the wrappers.
This commit is contained in:
Archit Gupta 2023-12-05 00:38:45 -08:00
parent 395ac91da0
commit 366733be87

View File

@ -32,8 +32,9 @@ in
nixosConfigurations = configs;
checks = foldl recursiveUpdate { } (mapAttrsToList
(n: v: {
${v.config.nixpkgs.system}."nixos-${n}" =
v.config.system.build.toplevel;
${v.config.nixpkgs.system}."nixos-${n}" = v.pkgs.runCommand
"check-nixos-${n}"
{ } "echo ${v.config.system.build.toplevel} > $out";
})
configs);
};