Merge pull request #8096 from tweag/filter-tests

Filter tests/nixos from source
This commit is contained in:
Théophane Hufschmitt 2023-03-24 12:06:26 +01:00 committed by GitHub
commit eed43de02f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -319,12 +319,18 @@
};
let
canRunInstalled = currentStdenv.buildPlatform.canExecute currentStdenv.hostPlatform;
sourceByRegexInverted = rxs: origSrc: final.lib.cleanSourceWith {
filter = (path: type:
let relPath = final.lib.removePrefix (toString origSrc + "/") (toString path);
in ! lib.any (re: builtins.match re relPath != null) rxs);
src = origSrc;
};
in currentStdenv.mkDerivation (finalAttrs: {
name = "nix-${version}";
inherit version;
src = self;
src = sourceByRegexInverted [ "tests/nixos/.*" "tests/installer/.*" ] self;
VERSION_SUFFIX = versionSuffix;
outputs = [ "out" "dev" "doc" ];