nt/flake/nix-unit.nix

35 lines
722 B
Nix
Raw Normal View History

2026-01-27 17:50:53 +10:00
{
this,
flake,
deps,
...
}: let
inherit
(deps)
nixpkgs
nix-unit
;
inherit
(this.util)
forAllSystems
;
in {
checks = forAllSystems (system: {
default =
nixpkgs.legacyPackages.${system}.runCommand "tests"
{
nativeBuildInputs = [nix-unit.packages.${system}.default];
}
''
export HOME="$(realpath .)"
# The nix derivation must be able to find all used inputs in the nix-store because it cannot download it during buildTime.
nix-unit --eval-store "$HOME" \
--extra-experimental-features flakes \
--override-input nixpkgs ${nixpkgs} \
--flake ${flake}#tests
touch $out
'';
});
}