add flake module
This commit is contained in:
parent
3fe748f174
commit
bc2a62e62b
4 changed files with 84 additions and 0 deletions
34
flake/nix-unit.nix
Normal file
34
flake/nix-unit.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
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
|
||||
'';
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue